Basic useful Linux Commands that you need đźš©

Sami Salhi
2 min readSep 10, 2022

--

Bismillah Guys !1

LS ( Listing directory contents )

ls

The ls command is used to view the contents of a directory. By default, this command will show the contents of your current working directory

  • ls -R will list all the files in the sub-directories as well
  • ls -a will show the hidden files
  • ls -al will list the files and directories with detailed information like the permissions, size, owner, etc.

CD Command ( Changing directory )

cd 

To navigate through the Linux files and directories,

When used without any argument, cd will take you to your home directory

So you’re in /home/username/Documents and you want to go to Photos, a sub-directory of Documents. To do so, simply type the following command: “ cd Photos “

  • cd .. (with two dots) to move one directory up
  • cd to go straight to the home folder
  • cd- (with a hyphen) to move to your previous directory

pwd Command ( Present working directory )

pwd

Use pwd command to find the path of the current working directory (folder) you’re in.

CAT ( Displaying file contents )

cat 

to read file , type cat followed by the file’s name and its extension →example cat hello.txt

touch ( Create File )

touch

create a blank new file , type touch followed by the file’s name and its extension

touch file.txt or touch web.html

rm ( Removing files and directories )

Removing empty file --> rm file.txtRemoving empty directory --> rm -d directoryname

Fast And important linux command

I hope you enjoyed ❤ .

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Sami Salhi
Sami Salhi

Written by Sami Salhi

Hola , Hello , Salut ... I am A Cyber Security Student And Researcher

No responses yet

Write a response