Some basic Linux commands

This is a list with some useful basic Linux commands:

sudo [command] -> It will execute command with elevated (administrative) privileges.

pwd -> This command is path to current working directory. Sometimes you need to check where you are in directory tree.

cd [folder] -> enter a folder. If we use cd .. -> exit the folder and go to the parent folder

ls -> list file in current directory, If we use ls -a -> then also the hidden files will be shown.

cat [file] -> print in the console the file content.

cp [file source] [file destination] -> copy file from source to destination. To copy whole folder with all of the files use cp -R [folder name] [folder destination]

mv [file source] [file destination] -> move file from one place to another. If the same place is set then it will rename the file as show in the example.

rm [file name or files name with while card] -> remove files if it is used with -R then can remove whole directory. rm -R [directory name]

Leave a Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.