CS113 Prelims - Chapter 4-6
Op
Mode Portion: Operator
head
cat command that displays the first n lines.
umask
4-digit octal number to determine the file permission for newly created files.
Other
All users other than the file owner, and members of the group that owns the file or the directory.
ls
Command that allows the user to look at the characteristics of a file.
more
Command that allows the user to look at the contents of a file, one screenful at a time.
cat
Command that allows the user to look at the contents of a file.
mv
Command that change the name of a file or directory.
chgrp
Command that changes access to a file; Only the owner of the file can change the group of the file.
chown
Command that changes the file ownership.
newgrp
Command that changes the group ID.
su
Command that changes your user ID and group ID designation.
diff
Command that compares 2 text files and finds differences.
ln
Command that create another name for a file.
mkdir
Command that creates directories or folders. The user must have the appropriate permissions to create a directory.
mkdir -p
Command that creates parent directories while creating lower level directories, including all the directories in a pathname.
groups
Command that displays all of the groups you are a member of.
pwd
Command that displays directory using absolute pathname.
wc
Command that displays line, word, byte, or character counts for a text file.
ls -F
Command that displays listing with a symbol to tell what the type the file is.
ls -l
Command that displays long listing of files including the file permissions.
ls -n
Command that displays the User ID and the Group ID.
ls -R
Command that displays the contents of all directories, subdirectories, and their contents for a particular part of the directory tree.
id
Command that displays the numeric and alphabetic UID and GID for your Effective User ID.
ls -l
Command that displays the owner and group who has access to the file.
touch
Command that either creates one or more files with 0 bytes if none exists; or updates date/time stamp if file already exists.
ls -a
Command that lists all files in a directory, including hidden (.) files and current (.) and parent (..) directories.
ls
Command that lists files and directories within the current directory or specified directories.
cp
Command that makes a copy of a file.
cd
Command that may take you to you home directory, up one level, or to a subdirectory.
mv
Command that moves a file to another directory.
lp
Command that prints a file.
rm -i
Command that prompts the user (y/n) before removing files.
rm -r
Command that removes DIRECTORIES including all subdirectories and files in it.
rm -ri
Command that removes DIRECTORIES interactively.
rm
Command that removes a SINGLE FILE or MULTIPLE FILES. These files are deleted permanently and cannot be recovered.
rm
Command that removes a file.
chmod
Command used to change the access mode of a file.
Ctrl U
Control Characters: Erases the command line.
Ctrl W
Control Characters: Erases the last word on the line.
Ctrl D
Control Characters: Indicates end-of-file or exit.
Ctrl C
Control Characters: Interrupts current activity.
Ctrl Q
Control Characters: Resumes screen output.
Ctrl S
Control Characters: Stops screen output.
rwxr-xr-x
Default permission for DIRECTORIES.
rw-r--r--
Default permission for FILES.
Octal
Eight possible numbers in group bits are either on (1) or off(0).
Regular File
File Types: -
Block Device File
File Types: b (disks)
Character Device File
File Types: c
Directory
File Types: d
Symbolically Linked File
File Types: l
Network Special File
File Types: n
255
Filename Specifications: Maximum of ___ characters if long filenames are supported.
chmod u-x,go+w file
How to remove execute permission to user, add write permission to group and others, to a file named File?
chmod o-r file
How to remove read permission of File to others?
../..
If your working directory is /home/user2/dir3, what is the relative pathname of /home?
Executable
In ls -F, this file has an asterisk (*) after the name.
Symbolic link
In ls -F, this file has an at sign (@)
ASCII Text File
In ls -F, this file has no symbol.
directory
In ls -F, this file is represented by a forward slash (/) after the name.
Change Directory
Meaning of cd.
Print Working Directory
Meaning of pwd.
Who
Mode Portion: Category you are working with.
Permission assigned
Mode Portion: Read(r), Write(w) or Execute(x)
-i
Option of diff command that ignores the case of the letters.
-c
Option of diff command that performs a detailed comparison and produces a listing of differences with 3 lines of context.
-c
Option of wc command that counts bytes.
-m
Option of wc command that counts characters.
-l
Option of wc command that counts lines.
-w
Option of wc command that counts words.
User
Owner/Creator of file or directory.
Group
Permissions used by members of the group that owns the file or directory.
No Permission
Permissions: A dash (-) indicates permission is denied.
Read
Permissions: r, File can be displayed or copied. Contents of a directory can be listed with the ls command.
Write
Permissions: w, File contents can be modified. Files can be added or deleted.
Execute
Permissions: x, File can be executed. Allows the find command to search thru directory.
Path Name
Represents the route through the hierarchy that is traversed to reach the desired file or directory.
User, Group, Others
The 3-tier structure of UNIX system to define who has access to each file and directory.
dot dot
The entry that represents the directory immediately above your current directory position.
dot
The entry that represents your current directory position.
-n
This option in cat tail command allows you to start displaying line from a specific point in a file.
True
True or False: If ls -R command was done at a high level in the directory structure, the output can be substantial.
True
True or False: When using cat head command, first 10 lines are displayed by default if the -n option is omitted.
False
True or False: When using cat tail, last 5 lines are displayed by default if the -n option is omitted.
False
True or False: Wildcard metacharacters (*) (?) cannot specify the files that the user wants to delete.
Relative Pathname
Type of Pathnames: Always starts at your current location in the hierarchy.
Relative Pathname
Type of Pathnames: The pathname does not begin with a slash.
Absolute Pathname
Types of Pathnames: /home/user3csc-12/f1
Absolute Pathname
Types of Pathnames: Specifies the entire file hierarchy.
Absolute Pathname
Types of Pathnames: Start at root (/) and list each directory along the path to the destination. Slash (/) between each directory name in the path.
tail
cat command that allows you to check the end result of the backup without looking at the whole file.
tail
cat command that displays the last n lines of a file.
-a time
touch Command: Change access time to time.
-m time
touch Command: Change modify time to time.
-c
touch Command: If the file does not already exists, do not create it.
-t time
touch Command: Use time as your current time.