36 Useful Terminal Commands

Carolina Cobo
2 min readApr 27, 2022

--

Here is a little list of terminal commands that you can find useful, I use some of them a lot and others from time to time.

source: pics.me.me

1. Print Current Working Directory. It will print the full path.

pwd

2. List of current directory contents

ls 

3. Change the directory

cd DirectoryName

4. To change to zsh shell.

chsh -s /bin/zsh

5. Clear the terminal logs

clear or cls

6. Copy files from the current directory to a different directory

cp source_file target_directory

7. Move files from the current directory to a different directory

mv 

8. Make a new directory

mkdir NameNewDirectory

9. Delete empty directories

rmdir 

10. Delete directories and contents within them (*be careful when using it)

rm DirectoryName

11. Create a new blank file

touch 

12. Find a file

locate

13. Search for files and directories within a given directory

find

14. Search through all the text in a file

grep FileName

15. Perform tasks that need admin or root permissions

sudo

16. Get a report on the systems disk space usage (% and KBs)

df 

17. Check how much space a file or a directory take

du 

18. View the first few lines of a text file

head

19. Display the last ten lines of a text file

tail

20. Compare the contents of two different files, line by line

diff 

21. Archive multiple files into a group of files collected together as one

tar

22. Change the read, write and execute permissions of files and directories

chmod

23. Transfer the ownership of a file to the specified username

chown

24. Display all current jobs along with their status

jobs

25. Terminate a program manually

kill

26. Check the connectivity status to a server

ping

27. Download files from the internet

wget 

28. Display a list of running processes and how much CPU each process uses

top

29. Get information about a Linux command

man

30. Move data into a file

echo

31. Compress files into a zip file

zip

32. Extract a zip file

unzip

33. Display the name of the host or network

hostname

34. Create a new user

useradd

35. Delete a user

userdel

36. After creating a user, it can be used to set a password for that user

passed

Thanks for reading, I appreciate your time! 🎉 If you need any help please reach out!

If you have any questions feel free to drop me a message on LinkedIn or send me an email. 😊

Have a nice day!

--

--

Carolina Cobo

Frontend Software Engineer @ Genesys | Career switcher