File Commands
Linux Essentials +
Command | Description |
---|---|
ls -al | Lists all files, detailed information, in long format. |
pwd | Displays the present working directory's path. |
mkdir dir1 | Creates a new directory named dir1. |
rm file1 | Deletes the file named file1. |
rm -f file2 | Forcefully deletes the file named file2. |
rm -r dir1 | Recursively removes directory dir1 and its contents. |
rm -rf dir1 | Forcefully deletes directory dir1 and its contents. |
cp file1 file2 | Copies file1, creating or overwriting file2. |
cp -r dir1 dir2 | Copies dir1 to dir2, including subdirectories. |
mv file1 file2 | Renames or moves file1 to file2. |
ln -s /path/to/file_name link_name | Creates symbolic link named link_name to file_name. |
touch file1 | Creates an empty file named file1. |
cat > file1 | Creates/overwrites file1, awaiting standard input. |
more file1 | Displays file1 content, paginating through output. |
head file1 | Displays the first ten lines of file1. |
tail file1 | Displays the last ten lines of file1. |
gpg -c file1 | Encrypts file1 with symmetric cipher using passphrase. |
gpg file2.gpg | Decrypts file2.gpg, prompting for the passphrase. |
wc | Counts words, lines, and characters in files. |
xargs | Executes commands with piped or file-provided arguments. |