Linux- directory commands

priyanka kumari
4 min readOct 31, 2023

--

What are Commands in linux

A Linux command is a program or utility that runs on the command line. Commands line is an interface that accepts lines of text and processes them into instructions for your computer.

· In Mac OS, and Linux it is called terminal, whereas, in windows it is called command prompt.

· Commands are always case sensitive.

· Linux skills are always in demand. Build your skill-set by learning how to use Linux directory commands and Linux file commands.

Pwd

It’s command stands for (print working directory). It displays the current working location or directory of the user. It displays the whole working path starting with /. It is a built-in command.

· Pwd -l:- This command is used to show the logical path of the current working directory with the name of the symbolic link .

· — help:- It shows the help message.

Ls

The ls is the list command in Linux. It will show the full list or content of your directory. Just type ls and press the enter key.

It is command is used to show the list of a folder. It will list out all the files in the directed folder.

· ls-a:- The (ls -a) command will enlist the whole list of the current directory including the hidden files.

· ls- l:- It will show the in long list format

· ls -n:-It is used to print group id and owner id instead of their names

· ls -version :- It check the version of ls command

Cd

The cd command stands for (change directory). It is used to change to the directory you want to work from the present directory

· Cd double dots(..):- (go out of the directory_

· d ~ or cd by itself will always bring the user to the home directory.

· cd . will allow the user to stay in the similar directory they are in currently.

· cd ~username will allow the user to stay in the home directory of the username.

· cd dir (not with /) will allow the user to stay in a subdirectory.

· cd .. will bring the user above one directory.

· cd — will change the user to the old directory

Mkdir

The mkdir stands for ‘make directory’. With the help of mkdir command, you can create a new directory wherever you want in your system. Just type “mkdir <dir name> , in place of <dir name> type the name of new directory, you want to create and then press enter.

· Mkdir -p(parents) :- Add directory including its sub directory.

· Mkdir -v(verbrose):- Print a message for each created directory

· mkdir command you can create your own directory.

Rmdir

The rmdir command is used to remove a directory from your system.

· Rmdir -p :- for this command you can remove parents and child both

Thanks for reading

I hope found this useful?

✅Reshare this with others so that it helps more people

✅Tag your colleagues and friends who you think will need this

--

--

priyanka kumari
priyanka kumari

Written by priyanka kumari

Cloud || Devops enthusiast|| Learning & helping

No responses yet