Linux Fundamentals PT1 Flashcards
(28 cards)
What is the general syntax of a Linux command?
command [options] [arguments]
What does ‘cd’ command do?
Changes the current directory
What does ‘pwd’ show?
Prints the current working directory
What does ‘ls’ do?
Lists files and directories
How do you create a directory?
mkdir <directory_name></directory_name>
How do you create an empty file?
touch <file_name></file_name>
How do you copy a file?
cp <source></source> <destination></destination>
How do you move/rename a file?
mv <source></source> <destination></destination>
How do you delete a file?
rm <file_name></file_name>
How do you delete a directory?
rm -r <directory_name></directory_name>
What are the permission characters in ‘ls -l’?
r (read), w (write), x (execute)
What are the user types in file permissions?
u (user), g (group), o (others), a (all)
How do you change file permissions using letters?
chmod u+x file
What is the numeric format for full permissions?
chmod 777 file
How to change file ownership?
chown user file
How to change group ownership?
chown :group file
How to change user and group at once?
chown user:group file
How do you get help for a command?
man <command></command>
What does ‘–help’ do?
Displays basic help for a command
What is the use of ‘info’ command?
Displays detailed documentation
What does Tab do in the shell?
Auto-completes file or command names
How do you add text to a file (overwrite)?
echo ‘text’ > file
How do you append text to a file?
echo ‘text’»_space; file
What does ‘>’ do in Linux?
Redirects output to a file (overwrite)