Linux OS Flashcards
How much does a Linux OS cost?
Free, Linux is an open source - community supported OS based on the outdated UNIX OS.
What Linux terminal command would you use to get help/more information on a command?
man commandName
Opens an online manual into the terminal detailing the command and its’ uses.
man - short for online manual
How would you display the working directory contents in Terminal on Linux?
ls = list directory
Works like dir in Windows CMD line.
ls -l = displays the list with a lot more information (like file size, last modified time, access (read/write mode)). -l stands for long version
What command lets you rename a file in Terminal (Linux)?
mv
Short for move - by “moving it” you are renaming it
E.g. mv fileName/source newFileName/Destination
How to copy a file in Linux terminal?
cp
CoPy
cp fileName destinationFileName
Delete a file in Terminal? How to delete a directory with files in it?
rm fileName
Removes/deletes a file.
rm -R directoryName
Removes a non-empty directory.
What permissions would chmod 520 fileName.txt assign?
5 = read and execute permissions to Current user
2 = write only permission for Group users
0 = No permissions for Other uses
What does chmod command do?
E.g. chmod 710 fileName
Change Mode (chmod) Linux command changes the permissions of user types for the file.
E.g. Users can read write and execute the file (7)
Group users can only execute the file (1)
Other users with lower permissions than users or group can’t access the file at all (0)
When viewing a directory with ls -l a the top line starts: drwx—— what does this mean. What permissions does each use group (3 characters represents each of the 3 user type groups after the initial character which designates type of file)
d = directory, so the top of the active/working directory is a subdirectory
rwx = top level users can read, write and execute the directory/full permissions - 7
— = group level users can’t access it at all/no permissions - 0
— = other/bottom level users can’t access it at all/no permissions -0
What would you type to grant group level users permissions permission to read only the following file and no permissions to low level/other users:
drwxrwxrwx thisFile.txt
sudo chmod 740 thisFile.txt
7 = all permissions for root-users/top level
4 = read-only permission for group users
0 = no permissions for bottom level users
What does sudo do?
Allows you to run commands with elevated permissions/as an admin.
sudo - short for Super User DO
Basically elevates your permissions to root user level for a SINGLE command (can do ALL/Super User)
How to change file owner and group?
sudo chown
sudo elevates access to admin which is required to change file owner/group
chown stands for chANGE ownER
e.g. sudo chown ownerName:groupName file.txt
Why doesn’t chown ownerName fileName.txt work to change the mode/owner of a file?
Because chown requires sudo before it to run the single command as a root-level user/admin.
sudo prompts you for a superuser password
How to run Linux terminal as admin/super user sessions?
su
Short for Super User - prompts you for the admin password and then runs all subsequent Terminal commands as Admin/Super-User/elevated permissions
To leave su mode: exit
What’s the advanced packaging tool abbreviated to in Linux terminal? And what does it do?
apt
Manages the installing and uninstalling of applications on a Linux system.
Requires sudo privileges.