Week 2 + 3 Flashcards
What do the commands below do?
tilda (~) command?
whoamii command?
pwd command?
cd command?
tilda(~) goes to the home directory
whoami checks who the user is
pwd checks the current working directory(where u are)
cd command changes directory listed after cd
What are Paths?
Types of Paths?
List of directories separated by /.
example: /home/tenzing/desktop
Types: Absolute(starts with /), and Relative
Differences with Absolute and Relative paths?
Absolute: starts with / root directory
Relative: starts at current directory. use .. to go back a directory or ../../
What does ls -a command do?
what does ls -l command do?
Shows all hidden files and folders, hidden folders will have a . in front
Gives a long list with detailed info.
1st Column: File type and access
permissions
* 2nd Column: # of HardLinks to the
File
* 3rd Column: Owner and the
creator of the file
* 4th Column: Group of the owner
In the ls -l command
The first character on each line indicates the type.
List the types:
d (directory)
- (regui]lar file)
l (symbolic link)
s (socket)
p (pipe)
b (block file)
c (character file)
drwxr-xr-x
define this
d(type)
rwx(read-write-execute for owner)
xr(perms for group)
x(perms for others)
r = read
x = execute
w = write
What does -h command do?
And describe human-readable format?
when file size too big makes it easier to read. M - megabytes, G - Gigabytes, T- Terabytes.
What are different ways to sort with ls command?
ls -r (recursive, sort backwards)
ls -s (sort by file size)
ls -t (sort by time)
How to use ls to get a detailed timestamp?
ls –full-time
How to get to the manual page on how to use glob?
man 7 glob
What does the asterisk(*) do? and uses?
- represents any name
d - name that ends with d
a - name that starts with a
c - name that contains c
a*c - name that starts w/ a and ends w/ c
- represents any name
What does the ? character do?
??? - names that contain 3 characters
d.??? - name that starts with d. then contains any 3 characters
What does the square brackets do
[ ]?
[abc]d - begins with either a, b, or c and ends with d.
[a-zA-Z][0-9] - begins with any letter lower or uppercase and ends with any number from 0-9
What does [!] do?
[!abc]d – this is a name that does NOT begin with either character ‘a’
or ‘b’ or ‘c’ and ends with character ‘d’
What do the curly brackets do?
Curly brackets {} are used to specify terms that are separated by commas and each term must be a name or a wildcard.
Same as IN (value1, value2) in DBAS