There has been a wide range of discussion in Islamic history about the background and the derivation of this term and I would like to mention a few as told by Imam Abul Qasim Qushayri (r.a) in his renown Sufi work called Al Risala Al Qushayriyya Fi ilm al Tasawwuf (Al Qushayris Epistle to Sufism). The Arabic term safa or صفاء means "purity" and "a man of purity" is referred to as rajul sufi - رجل صوفي with the word sufiyya - الصوفية being the plural. The plural sufiyya in Arabic came to be known as Sufis (& sufism) in English. It is also claimed that it may have derived from the word suf - صوف which means "wool"; therefore, the verb tasawwuf - التصوف would mean “to wear wool” because the people of this path were famous for wearing it. Then there is a claim that sufi - صوفي is derived from the word “row” (saff) - صف, meaning that they (sufis) are in the front row in all jamaats (prayer congregations) with their hearts and before Allah ﷻ. There are also those who argue that the sufis derive their name from the "covered room" (suffa) - صوفا, the room adjacent to the Prophet Muhammad's masjid in early Islam which sheltered the most poorest of his companions, and were fed and taken care by him and his family. Despite that many of these terms have been considered as origins of sufi yet they are challenged by others on linguistic and etymological grounds. I believe that a comprehensive definition of the term sufi and sufism is given by Abu Muhammad Al Jurayri (r.a), the disciple and successor of Junayd Al Baghdadi, the famous sufi of Baghdad, who said "It means assuming every sublime moral character trait and giving up every lowly one." This definition sums up for us the primary purpose of why Allah ﷻ created humans, as per Quran and a sufi is someone who struggles to fulfill that purpose to the best of their ability.
 Al-Qushayri’s Epistle on Sufism, Al-Risala al-qushayriyya fi ilm al-tasawwuf
Abul-Qasim al-Qushayri, Translated by Professor Alexander D. Knysh, Reviewed by Dr Muhammad Eissa
Many people have misunderstanding about Tasawwuf or Sufism, thinking it is something beyond the Quran and Hadith/Sunnah. This has happened due to the fact that some Ulama & Muftis (Scholars) of Islam has shunned and claimed the path of Tasawwuf to be bid’ah (innovation) while those who have taken the garb of Sufis (tasawwuf experts) do not give importance to the Shariah i.e. Quran and Hadith/Sunnah, as they’re supposed to.
Tasawwuf is not an innovation and did exist at the time of Prophet Muhammad ﷺ just like all other practices within Islam, however the term itself did not exist, it was a later development. For instance the term Usul Al Fiqh which means "Islamic Jurisprudence" is a science on the practice of Islamic rules and regulations that existed at the time of Prophet Muhammad ﷺ but the term did not exist. The Sahabas (Prophet's companions) did not refer to this knowledge as Usul Al Fiqh as we know it. The necessity of Usul Al Fiqh is extremely important as it has guided Muslims through centuries of how to practice rules and regulations of Islam in their daily lives. The scholars of the later centuries developed this science further as there was continuous need of it and therefore this term came to be. Another example is the Ilm Al hadith meaning "sciences of hadith". The hadith were being collected at the time of Prophet ﷺ but the science and methodology of collection did not exist till many decades after him. As Islam spread and companions went to different parts of the world to preach, hadith were written by those who enjoyed their company. Then came the requirement for a process that would distinguish authentic from the weak and fabricated hadith, hence the subject of Ilm al hadith came to exist.
Tasawwuf means (Islamic) science of gaining purity to attain spirituality, this is simply because we are not just Ruh (spirit) and neither are we just physical body, we are both. Gaining purity will help increase one’s spirituality, which is the heart of Islam because the main purpose of our creation is to gain communion with our Creator, Allah ﷻ, which can only be fulfilled through the medium of our hearts, as Allah ﷻ reminds: “Verily, he who has purified the heart is successsful and he who had despoiled it has lost.” (Al Quran 91:9–10). The Prophet ﷺ also said “There is one piece of flesh in the body which if it is good, the whole body will be good and if it is ruined then the entire body is ruined, and that piece is the heart.” (Hadith)
Tasawwuf is an internal enlightenment that can only be attained through the medium of our hearts but the process for it begins by following obligatory external rulings which fall within the sphere of Shariah (sacred law) such as Salaah (5 daily prayers), Zakah (obligatory charity), Fasting (30 days in Ramadaan), and other necessary acts according to the Sunnah (way) of Prophet Muhammad ﷺ. Just as there are topics within the Quran and the books of Hadith/Sunnah that teach external acts on Salaah, Zakah, rules on marriage and divorce, trading and commerce, they also include chapters on internal acts on how to control one’s anger, how to behave righteously and maintain a good character, preventing Riya (showing off), purifying one’s heart of jealousy & malice, keep a check on one’s lust (nafs) & ability to indulge in unnecessary arguments. Tasawwuf primarily focuses on perfecting these internal acts, and historically Sufis are those Islamic saints that perfected those characteristics within themselves and became examples for other to follow. Hence it is the external and internal Islamic obligations combined within individuals that assist in attaining spirituality in Islam called Tasawwuf. Very importantly Imam Malik (r.a), one of the greatest Imams in the history of Islam said: “He who practices Tasawwuf without learning Sacred Law (Shariah) corrupts his faith, while he who learns Sacred Law (Shariah) without practicing Tasawwuf corrupts himself. Only he who combines the two proves true.”
 It is related by the muhaddith Ahmad Zarruq (d. 899), the hafiz `Ali al-Qari al-Harawi (d. 1014), the muhaddiths `Ali ibn Ahmad al `Adawi (d. 1190) and Ibn `Ajiba (d. 1224), and others - http://sunnah.org/tasawwuf/scholar4.htm#2
Tasawwuf is basically the science of gaining spirituality through the use of your heart. Heart in Islam is the bridge than connects the physical side of our’s with spiritual. The heart needs continuous purification as rust of earthly distractions & ignorance tarnish it and we may not be able to fully attain the purpose of our existence. The purpose of our existence is mentioned in the following Quranic verse: (Al Quran 51:56) "And I did not create the jinn and mankind except to worship Me." In this verse the term Ibaadah in Arabic is usually translated as "worship" was understood as "knowledge" by the early Muslims such as Ibn Abbas (r.a), the cousin of the Prophet ﷺ and known as the Scholar of this ummah (Muslims). He explained the above verse as "knowledge" meaning we have been created to gain communion with Allah ﷻ and its through His knowledge that we can may live our purpose.
We have been created to know Allah ﷻ and by knowing Him will benefit us. As there is a famous Hadith Qudsi (words of Allah ﷻ) the Prophet ﷺ was told by Allah ﷻ that: "I was a hidden treasure; then I wished to become known. Then I created the creation, so that I may be known." The knowledge of Allah ﷻ is revealed only to those hearts that carry the light of Imaan (belief). The cleaner the heart and stronger ones belief is the more knowledge Allah ﷻ bestows. The Prophet ﷺ said “There is a piece of flesh inside every body, if it is good entire body will be good and that is the heart.” (hadith) As Allah ﷻ has mentioned in the Quran that those whose hearts are pure, clean and humble are the ones who will be successful on the day of judgment: [Al Quran 26:88] "The day on which property will not avail, nor sons ….Except him who comes to Allah with a heart free (from evil)."
The only thing that obstructs this heart from gaining knowledge is our Nafs (human self or base urges) also referred to as Soul in English. This Nafs has inherent tendencies which makes us have attraction towards earthly pleasures and distractions. It continuously strives to attach us to the earth and its beauties so we may deviate from our purpose of life and to the point of even forgetting our Creator. It is due to this reason why the Sufiyya or Sufis (Saints) have always emphasized on Greater Jihad (struggle) as the ultimate goal of life which is to strive against our own Nafs. This is due to a famous hadith of the Prophet ﷺ who referred to greater Jihad as “The servant’s struggle against his lust (hawah).” as opposed to lesser jihad which is fighting with arms in defense.
The Lust termed as Hawah (or Hawass in Urdu, or shahwat in Persian) is also mentioned in the Quran that our Nafs generates to pull us away from Allah ﷻ: [Al Quran 7:176] "And if We had pleased, We would certainly have exalted him thereby; but he clung to the earth and followed his low desire (Hawa)." Allah ﷻ would exalt in ranks those who strive against the influences of Nafs. Allah ﷻ has given a description of those who keep their hearts attached to Allah ﷻ and do not submit to their lust & desires and He advises the believers to follow their path: (Al Quran 18:28) "And keep yourself patient [by being] with those who call upon their Lord in the morning and the evening, seeking His countenance. And let not your eyes pass beyond them, desiring beauties of the worldly life, and do not obey one whose heart We have made heedless of Our remembrance and who follows his desire (Hawa) and whose affair is ever [in] neglect."
Allah ﷻ has praised these people who are calling upon Him morning and evening and involved in doing His Zikr (Remembrance) and He tells us elsewhere as to why their hearts are not easily distracted by worldly attachments: (Al Quran 13:28) "… and whose hearts find peace in the remembrance of God- truly it is in the remembrance of God that hearts find peace." As their hearts being at peace due to Zikr (remembrance) distractions of the Nafs and Hawa do not bother them, they are at peace with their Lord as there is another Hadith Qudsi that Prophet ﷺ told us from Allah ﷻ “Heavens and the earths cannot contain Me but within the momin’s (believers) heart I enter like a guest.” It is the effects of our Hawa which cause distractions to our Hearts that are generated from our Nafs. If we continue to fight them with Jihad (struggle) and remain stead fast then Allah ﷻ will make ways for us to gain closeness to Him so we may succeed in the purpose of life: (Al Quran 29:69) "But as for those who strive hard in Our cause (Jahaduu) - We shall most certainly guide them onto paths that lead unto Us: for, behold, God is indeed with the doers of good.
How Heart of a Mumin (believer) gains knowledge of Allah.
According to Sufi literature there is a saying from the Prophet ﷺ that Qalbu Mumin ArshAllah meaning “The heart of a Mumin (believer) is the Throne of Allah.” the throne of Allah represents His dominion and His Kingdom. Due to hearts being pure and attached to Allah ﷻ gain the spiritual access to His throne in the heavens where the knowledge of the unseen is available. This hadith points us towards the nearness these hearts gain with Allah and this is also confirmed by one of the verses of the Quran: (Al Quran 40:07) "THEY WHO BEAR [within themselves the knowledge of] the throne of [God's] almightiness, as well as all who are near it, extol their Sustainer's limitless glory and praise, and have faith in Him, and ask forgiveness for all [others] who have attained to faith: "O our Sustainer! You embrace all things within [Your] grace and knowledge: forgive, then, their sins to those who repent and follow Your path, and preserve them from suffering through the blazing fire!" (Assad Translation) Muhammad Asad in his commentary Message of the Quran translated the above verse as such based on the commentary of the great Persian scholar Imam Al-Baydawi author of Tafsir al-Baydawi. Imam Baydawi explains that "those who are near the Arsh (Throne) of Allah" are not only Angels but also those humans whose hearts are attached to Allah ﷻ:
“In his commentary on the verse which we are now considering, Baydawi states explicitly that the "bearing" of God's throne of almightiness (al-'arsh - see note 43 on 7:54) must be understood in a metaphorical sense: "Their carrying it and surrounding it [or "being near it] is a metaphor of their being mindful of it and acting in accordance there with (majaz 'an hifzihim wa tadbirihim lahu), or a metonym (kinayah) for their closeness to the Lord of the Throne, their dignity in His sight, and their being instrumental in the realization of His will." But whereas it cannot be denied that the present verse refers also to angels, it does not follow that it refers exclusively to them. In its abstract connotation, the verb hamala frequently signifies "he bore [or "took upon himself"] the responsibility [for something]": and so it is evident that it applies here not only to angels but also to all human beings who are conscious of the tremendous implications of the concept of God's almightiness, and hence feel morally responsible for translating this consciousness into the reality of their own and their fellow~beings' lives.” (Surah Al Ghafir)
Allah ﷻ says in Quran how he created the universe and He is established over His Throne from where He commands all the affairs of His creation and the knowledge of everything lies with Him. (Al Quran 10:03) "Who created the heavens and the earth in six days, then established Himself on the Throne (of His Dominion), governing all affairs of the universe …" (Al Quran 65:12) "The Command descends among them, so that you may know that Allah is powerful over every thing, and that Allah has encompassed every thing in knowledge." These hearts that keep themselves pure due to continuous struggles (jihad) against their own Nafs (human self or base desires) gain nearness and access to the assembly of Angels near the Throne of Allah from where all knowledge descends and their hearts are filled with them. Tasawwuf is that science that can assist us in achieving that.
Interesting account on the death of Sufi Shaykh Bayazid Bistami (r.a)
Once a man who lived in the town of Shaykh Bayazid Bistami(r.a) saw himself in a dream carrying the throne of Allah on his head. He was amazed when he got up and was restless in his efforts to find out why he had seen such a dream. He decided to go to the Shaykh to find out the interpretation but soon discovered that earlier today the Shaykh passed away. Feeling so sad due to news of the loss such big loss and also wondering how would he find out the true meaning of his dream. Suddenly when the funeral with the Janazah (bier or coffin) of Shaykh was being carried by people in the streets to be buried he joined the crowds and being pushed around found himself underneath the Janazah (bier) while carrying it on his head. Right at that moment he realized the interpretation of his dream and praised Allah and made abundant dua for blessings on the Shaykh. This dream explains for us as to how the heart of the Shaykh had become the Throne of Allah due to his proximity and closeness with Allah. His heart was one of those where secret knowledge of the heavens was disclosed and no doubt the life of this Saint of Islam proved that as well.
Please also read Islamic Spirituality: the forgotten revolution By Shaykh Abdul Hakim Murad ISLAMIC SPIRITUALITY: the forgotten revolution .
The Sufi path is one's quest for Maarifat i.e. knowledge of Allah ﷻ, the divine knowledge gained spiritually which is disclosed to the hearts that carry thirst for it and are prepared to struggle and are patient enough to be gifted. It is not an easy path as Prophet Musa (alaihi salaam) would not have said the following words in his quest of this knowledge to reach and learn from the Mystic Khidr (alaihi salaam): (Al Quran 18:60) "…I will not cease [traveling] until I reach the junction of the two seas or continue for a long period."
The Sufi path is compared to the path of Musa (alaihi salaam) which might "continue for a long period" which indicates struggle and intense traveling. The resolve required to travel and reach the destination should be the same as expressed in his words "I will not cease (traveling)" regardless of difficulties. The destination of the Sufi path is the "junction of the 2 seas" which represents 2 oceans of knowledge i.e. external knowledge and internal knowledge. The external knowledge is the outer aspects of Islam which are extremely important to adhere to before you go further on your journey. The junction where Musa (alaihi salaam) struggled to reach was the point from where one can gain access to internal knowledge which is gained spiritually referred to as Maarifat - spiritual divine knowledge that brings one closer to Allah ﷻ, whereas the highest stage of attaining such knowledge is called ilme laduni (also referred to as divine knowledge) or ilhaam (inspiration) experienced by mystics such as Khidr (alaihi salaam).
The purpose of our existence is to know Allah ﷻ and establish a strong spiritual connection with Him at all times and that is the foundation of Sufi path. Any uncertainties, misinterpretations, innovations on this path can weaken our spiritual connection with Allah ﷻ and prevent us from His Maarifat. It is actually through Maarifat that we continue to come closer to Him. The most difficult obstacle of this path is our own Nafs (evil commanding soul) and it is due to this reason the blessed Prophet Muhammad ﷺ compared striving against it as greater than fighting an enemy in a battle:
“You have come for the best, from the smaller jihad (al-jihad al-asghar) to the greater jihad (al-jihad al-akbar).” Someone said, “What is the greater jihad?” He said: “The servant’s struggle against his lust (evil self).” (Al Bayhaqi) The one who can overpower their Nafs succeeds in crossing the "junction of the 2 seas" and it is due to this reason Prophetic saying usually quoted in Sufi circles is: “He who knows his own Nafs has known his Lord” (Hadith) The Nafs is the bridge that connects the 2 seas and crossing over should be the primary focus and purpose in this path.
Therefore this path is difficult and had it not been difficult the people of this path (i.e. Sufis) would not have been the strongest in their obedience and love for Allah ﷻ and His Messenger ﷺ. Anyone who initiates to travel on this path can not travel alone due to it being difficult. They need a spiritual guide in addition to one’s own learning and practicing, just like Musa (alaihi salaam) required the mystic Khidr (alaihi salaam) for his journey ahead. One of the famous Sufis Abu Ali Daqqaq (r.a) gave the example of a novice traveler to a plant which if it grows on its own will have defects but if its taken care by a gardener its growth will be much better, it will also give flowers and fruits. We are the plants, the spiritual Imams are the gardeners, the process is long and difficult but not impossible.
Please also read: Is Tasawwuf a Bid'ah (Innovation) in Islam?
Muhyiddin Ibn 'Arabi
Documentation of the Hadith of Jihad al-akbar (Greater Jihad)