Important Linux Commands for general knowledge — 1
The most possible reason to learn the commands is because there are some commands accessible only via shell that can control very complex operations on Unix/Linux and Windows machines. Here we are considering some important Linux commands that could help. It is categorized in to several instances where we can use them.
View Directories/content
Check the content on current directory
lsYou can view more details about the files, like ownership and permissions, by adding the flag -l to the ls command.
ls -1To see the hidden files in the current directory
ls -aTo find out where you are in relation to the rest of the file system
pwdTo navigate to different directories
cd /path/to/other/direcotryTo check out the contents of a file
cat /path/to/file/file_nameCreate new Folders
To make a new folder
mkdir dir_nameTo make two or three folders
mkdir dir1 dir2 dir3Remove Folders
To remove a directory
rmdir dir_nameTo remove directories
rmdir dir1 dir2 dir3 dir4Copy Files
To Copy a file to a specific directory
cp /home/user/source_file /home/user/duplicates/target_fileTo copy multiple files
cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/Move Files
To move one or more files or directories into a different location, or rename them to a new name
mv /home/user/source_file /home/user/moved_files/target_fileSearch Files
To search through files for the occurrence of a string of characters that matches a specified pattern
grep -rw /home/user/Downloads -e “vacation”Edit files
to open the Nano editor and modify an existing file, or create a new one
nano /path/to/existing/fileTo save modifications to the file
Ctrl+OTo close and exit the program using
Ctrl+XTo get help using
Ctrl+GTo exit help mode
Ctrl+XFrom Next Article, Create, Modify, and Remove File and Folder Permissions in Linux.Go here.
