Essential Linux Commands Every Beginner Should Know
Linux commands form the backbone of navigating and manipulating files and directories in a Linux environment. If you're just starting out with Linux, understanding these basic commands will help you feel more comfortable and efficient when working with your system.
Listing Commands
ls List files and directories in the current directory
ls -l List in long format with extra details
ls -a List all files, including hidden ones
ls *.sh List files with a .sh extension
ls -i List with inode index numbers
ls -d / List only directories (can specify patterns)
Creating directories is straightforward with the mkdir command:
mkdir newFolder Create a new folder 'newFolder'
mkdir .NewFolder Create a hidden directory (useful for configuration files)
mkdir A B C D Create multiple directories simultaneously
mkdir /home/user/Mydirectory Create a directory in a specific location
mkdir -p A/B/C/D Create nested directories
File manipulation commands
cat -n filename View the content of a file and display line numbers
chmod 700 filename Change the access permissions of files to make them readable, writable, and executable by the owner only
history | tail -n 10 Check the last 10 commands you have run
rm -r directory_name Remove a directory and all its contents
echo -e "Apple\nMango\nBanana\nCherry\nKiwi\nOrange\nGuava" > fruits.txt cat fruits.txt Create a .txt file, add content (one fruit per line), and display the content
wc fruits.txt Count the number of lines, words, and characters in both fruits.txt
Comments
Join the discussionNo comments yet. Be the first to comment.