Lesson 6: Managing Linux and macOS Flashcards
System component providing a command interpreter by which the user can use a kernel interface and operate the OS.
shell
Command interpreter and scripting language for Unix-like systems.
bash
Software that implements input and output for a command shell.
terminal
tty
teletype
Device that implements input and output for a command shell. In Linux, multiple virtual consoles support use of a single host by multiple user sessions simultaneously.
console
Command-line text editor operated by CTRL key combinations.
Nano text editor
•
•
FHS
File system Hierarchy Standard
Linux command for showing the current directory
pwd
* (“Print Working Directory”)*
What is the cd command used to do?
change the working directory
What does the ls command do?
listing file system objects
ls lists the contents of a directory, in a similar way to dir at the Windows command prompt. Popular parameters include -l to display a detailed (long) list and -a to display all files including hidden or system files.
Linux command to view and combine (concatenate) files.
cat command
•
•
In Linux, there are overwrite and append redirection operators: What does this command do *cat»_space; file**?
Append the cat data to the destination file
Command-line Linux tool used to search the file system
find command
Linux command for searching and filtering input. This can be used as a file search tool when combined with ls
grep command
what does grep stand for
Globally search a Regular Expression and Print command is used to search and filter the contents of files. Its output prints (displays) the lines that contain a match for the search string.
Command-line tool for copying files in Linux
cp command
Copy file1.txt in the current working directory to a new file called file1.old in the same directory
cp file1.txt file1.old
Copy the file hosts from the directory /etc into the directory /tmp , keeping the file name the same:
cp /etc/hosts /tmp
Copy all files beginning with the name message from the /var/log directory into /home/david. The -v option displays the files copied:
cp -v /var/log/message* /home/david
Command-line tool for moving files in Linux
mv command
Move the file data.txt from the /home/david directory to the /tmp directory, keeping the file name the same:
mv /home/david/data.txt /tmp
Move and rename the file alarm.dat in the current directory to alarm.bak in /tmp:
mv alarm.dat /tmp/alarm.bak
Rename the file app1.dat in the /var/log folder to app1.old:
mv /var/log/app1.dat /var/log/app1.old
Command-line tool for deleting file system objects in Linux
rm command
Remove the single file data.old from the current working directory:
data.old
Remove all files ending in .bak from the /var/log directory:
rm /var/log/.bak*
Remove the contents of the entire directory tree underneath the folder /home/david/data:
rm -r /home/david/data
Command-line tools used to report storage usage in Linux. Can be used to delete files. It can also be used with the -r option to delete directories
df and du command
disk free and disk usage
Linux commands allowing a user to use the root account or execute commands restricted to privileged users
su command
switch user
Linux commands allowing a user to use the root account or execute commands restricted to privileged users
sudo command
superuser do
What is the main advantage of sudo over su command?
The main advantage of sudo over su is that the root password does not have to be shared between multiple administrators.
Linux uses a permissions system with three rights, what are they? (3)
Read (r), Write (w), and Execute (x)
Read (r) gives permission to view the contents of a file or directory.
Write (w) gives permission to modify or delete the object. In the case of directories, this allows adding, deleting, or renaming files within the directory.
Execute (x) gives permission to run an executable file or script. For directories, execute allows the user to do things such as change the focus to the directory and access or search items within it
Linux command for managing file permissions
chmod command
Linux file-permission mode that uses numeric values to represent permissions
octal notation
Linux command for managing the account owner for files and directories. Allows the superuser to change the owner of a file or directory.
chown command
APT
Advanced Packaging Tool
Used by Debian distributions and works with .deb format packages.
APT