Moving, Copying, Deleting & Viewing files in Linux / Bash scripting is a necessity, these tasks are performed very commenly while working in Linux environments, following are few Linux commands to perform said tasks:
List files in current directory using long format.
List files in current directory and indicate the file type.
List all files in current directory in long format and display in columns.
Remove a file or directory called name.
rm -rf name
Kill off an entire directory and all it’s includes files and subdirectories.
cp filename /home/dirname
Copy the file called filename to the /home/dirname directory.
mv filename /home/dirname
Move the file called filename to the /home/dirname directory.
Display the file called filetoview.
man -k keyword
Display man pages containing keyword.
Display the file called filetoview one page at a time, proceed to next page using the spacebar.
Display the first 10 lines of the file called filetoview.
head -20 filetoview
Display the first 20 lines of the file called filetoview.
Display the last 10 lines of the file called filetoview.
tail -20 filetoview
Display the last 20 lines of the file called filetoview.
Hope these commands would be helpful.Contact Us for News Tips, Corrections and Feedback