Working with the File System and Permissions Flashcards
Which command is used to print any human-readable strings from a file to the terminal?
strings {file}
How to create a copy of a file?
cp {file} {nameOfTheFileCopy}
How to determine what file type is a certain file?
file {file}
How to sort a file alphabetically and remove duplicate adjacent lines?
sort -u
How to sort a file alphabetically in a reverse order?
sort -r
How to sort a file alphabetically?
sort
How to push the entire file to the screen and reverse the order of items in the file?
tac
How to push the entire file to the screen?
cat
How to display information about files/directories in a directory?
ls -l
How to display content of a directory including hidden files?
ls -a
How to delete a non-empty directory?
rm -r {dirName}
How to delete an empty directory?
rmdir
How to create a directory?
mkdir {directory}
Which command is used to view permissions in the terminal?
ls -l
Expalain -rwxrw-r--
-
-
indicates the type of file (e.g., - for a regular file, d for a directory) -
rwx
show the permissions for the user -
rw-
show the permissions for the group -
r--
show the permissions for others