Basic Linux commands

Basic Linux commands

Β·

2 min read

About Linux

Linux is a free and open-source operating system kernel that was originally created by Linus Torvalds in 1991. It is one of the most widely used operating systems in the world, especially in the server market and among developers. It has multiple flavors like Cent OS, Ubuntu, Fedora, Redhat, and Debian.

Basic command on Linux

πŸ‘‰ whoami >> to check the current user

πŸ‘‰ ls >> to check files and directories

πŸ‘‰ls -l >> List the files and directories in a long list format with extra information

πŸ‘‰ls *.sh>> List all the files having .sh extension.

πŸ‘‰ls -i>> List the files and directories with index numbers inodes

πŸ‘‰ls -d */>> List only directories.(we can also specify a pattern)

πŸ‘‰date >> to check the current date

πŸ‘‰touch >> to create a new file

πŸ‘‰mkdir >> to make a directory in a specific location

πŸ‘‰pwd >> print work directory. Gives the present working directory.

πŸ‘‰cd .. >> Change directory to the provided path

πŸ‘‰cd ~ >> Change directory to the home directory

πŸ‘‰cd .. /.. >> Change directory to 2 levels back.

πŸ‘‰cd home/my_folder >> to go destination directory

πŸ‘‰echo>> to print something

πŸ‘‰cat >> to write/see content in the particular file

πŸ‘‰rm -r/-rf >> to delete files and directory

πŸ‘‰mv >> to rename and move the file from one directory to another directory

πŸ‘‰cp >> to copy files to one directory

πŸ‘‰man any executable command >> can see detail description of that command

πŸ‘‰adduser \>> to create a new user account

πŸ‘‰userdel -r \>> to delete user account

πŸ‘‰Create a nested directory A/B/C/D

Β