File Commands

Linux Essentials +

Command Description
ls -alLists all files, detailed information, in long format.
pwdDisplays the present working directory's path.
mkdir dir1Creates a new directory named dir1.
rm file1Deletes the file named file1.
rm -f file2Forcefully deletes the file named file2.
rm -r dir1Recursively removes directory dir1 and its contents.
rm -rf dir1Forcefully deletes directory dir1 and its contents.
cp file1 file2Copies file1, creating or overwriting file2.
cp -r dir1 dir2Copies dir1 to dir2, including subdirectories.
mv file1 file2Renames or moves file1 to file2.
ln -s /path/to/file_name link_nameCreates symbolic link named link_name to file_name.
touch file1Creates an empty file named file1.
cat > file1Creates/overwrites file1, awaiting standard input.
more file1Displays file1 content, paginating through output.
head file1Displays the first ten lines of file1.
tail file1Displays the last ten lines of file1.
gpg -c file1Encrypts file1 with symmetric cipher using passphrase.
gpg file2.gpgDecrypts file2.gpg, prompting for the passphrase.
wcCounts words, lines, and characters in files.
xargsExecutes commands with piped or file-provided arguments.