File Directory Flashcards
ls -al
List all files in a long listing (detailed) format
pwd
Display the present working directory
mkdir directory
Create a directory
rm file
Remove (delete) file
rm -r directory
Remove the directory and its contents
recursively
rm -f file
Force removal of file without prompting for
confirmation
rm -rf directory
Forcefully remove directory recursively
cp file1 file2
Copy file1 to file2
cp -r source_directory destination
Copy source_directory recursively to
destination. If destination exists, copy
source_directory into destination,
otherwise create destination with the
contents of source_directory
mv file1 file2
Rename or move file1 to file2. If file2 is
an existing directory, move file1 into directory
file2
ln -s /path/to/file linkname
Create symbolic link to linkname
touch file
Create an empty file or update the access
and modification times of file
cat file
View the contents of file
less file
Browse through a text file
head file
Display the first 10 lines of file