Unit 4 Module 3 - Linux Bash Commands Flashcards
What command prints the working directory to the screen?
pwd
What command displays names of the files and directories in the current working directory?
ls
(LS)
What command navigates between directories?
cd
What command displays the content of a file?
Reading File Content Command
cat
What command displays just the beginning of a file? ( First 10 lines of text files )
Reading File Content Command
head
What command displays just the end of a text file? ( First 10 lines )
Reading File Content Command
tail
What command returns the content of a file one page at a time?
Reading File Content Command
less
What command searches a specified file and returns all lines in the file containing a specified string?
Searching for a certain keyword in a file
grep
grep OS updates.txt
grep is the command.
OS is the arguement we are looking for
updates.txt is the file we are looking into
Searching for a certain keyword in a file
What sends the standard output of one command as standard input to another command for further processing?
| (Piping)
What command searches for directories and files that meet a specified criteria?
find
find /home/analyst/projects searches for everything starting at the projects directory.
What do you call modifying the behavior of a command and commonly begins with a hyphen ( - ) ?
Options
What command creats a new directory?
mkdir
What command deletes a directory?
rmdir
What command creats a new file?
touch
What command deletes a file?
rm
What command moves a file or a directory to a new location?
mv
What command copies a file or directory into a new location?
cp
What command displays permissons to files and directories?
ls -l
( LS -L )
What command displays permssions to files and directories including hidden files?
ls -la
(LS -LA)
What command changes permissions on files and directories?
chmod
stands for change mode
What are the commands for the 3 types of users?
User, Group, and Other
User = u
Group = g
Other = o
The + adds permssions and - minus permissions.
chmod g+w, o-r access.txt
What does each letter/symbol mean in this equation?
chmod g+w, o-r access.txt
chmod - Change permssions with files/directories
g+w - Group has gained the permssion to write
, - is giving you the ability to do more commands
o-r - Other is lossing the reading permssion
These are changing the permssions of access.txt
What is the character for each of the reading permissions?
1) Read
2) Write
3) Execute
1) Read - r
2) Write - w
3) Execute - x
What is this reading permssion?
For files, this is the ability to read the file contents; for directories, this is the ability to read all contents in the directory including both files and subdirectories
Read permission