Skip to main content

Command Palette

Search for a command to run...

Basic Linux Commands

Published
2 min readView as Markdown
K

Looking for an entry-level position to kickstart my career in a dynamic and progressive company through which I can contribute in design, developing and deploying software that have a purpose and play significant role in company’s growth.

  • ls --> The ls command is used to list files or directories in Linux and other Unix-based operating systems.

ls

  • ls -l--> Type the ls -l command to list the contents of the directory in a table format with columns including.

    - content permissions - number of links to the content - owner of the content - group owner of the content - size of the content in bytes - last modified date / time of the content - file or directory name

Uploading ls -l.png…

  • ls -a --> Type the ls -a command to list files or directories including hidden files or directories. In Linux, anything that begins with a . is considered a hidden file.

ls -a

  • ls *.sh -->

ls * sh

  • ls -i --> List the files and directories with index numbers in oders

ls-i

  • ls -d */ --> Type the ls -d */ command to list only directories.

ls-d*

Directory commands

  • pwd --> Print work directory. Gives the present working directory.

pwd

  • cd path_to_directory --> Change directory to the provided path.

cd

  • cd ~ or just cd --> Change directory to the home directory.

cd ~

  • cd - --> Go to the last working directory.

cd -

  • cd .. --> Chnage directory to one step back.

cd

  • cd ../.. --> Use ls ../.. for contents two levels above.

cd  bs

  • mkdir directoryName --> Use to make a directory in a specific location

mkdir

  • mkdir .NewFolder --> Make a hidden directory (also . before a file to make it hidden)

mkdir

  • mkdir A B C D --> Make multiple directories at the same time.

mkdir A B C

  • mkdir /home/user/Mydirectory --> make a new folder in a specific location

mkdir inside

  • mkdir -p A/B/C/D --> Make a nested directory

mkdir-p

More from this blog

Untitled Publication

20 posts