File Commands Flashcards
ls
List
List files in a directory
ls -R
List all files in the subdirectory
ls -a
List all hidden files
cat
List the contents of a file
cat > filename
Creates a new file
diff
Compare the contents of two files line by line
tar
Extract, compress, and archive multiple files in linux
tar xf [yourfile_file.tar]
Extract file
tar czf
Creates a gzip compressed tar file
tar cf
Create an archive file from a file
gzip
Compress a file with the .gz extension
chmod
Change the read write and execute permissions of files and directories
chown
Change or transfer file ownership
rm
Remove a file
rm -r
Remove a directory recursively
wc
Print the number of words, lines, and bytes in a file
cp
Copy files from the current directory to a different directory
wget
Download files from the internet
cp -r
Recursively copy the contents of the first file to the second file
mv
To move or rename files
ln -s
Create a symbolic link
touch
Create a new file
More “file name”
Shows the contents of a file
head “filename”
Show the first ten lines of a file