-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirstLabNotes.txt
More file actions
132 lines (100 loc) · 3.4 KB
/
firstLabNotes.txt
File metadata and controls
132 lines (100 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
What is open source software:
- Source Code is publically available
- Anyone can modify
Open Source Operating Systems (Os's):
- Kernel: Core of operating system (Abstraction of hardware!)
- Allocates time and memory to programs
- Handles the file system and communication b/t soft and hardware
- Shell: Interface between user and the kernel
- Interprets commands user enters
- Takes action to enable and cause commands to be executed
- Programs
Command Line Interface (CLI):
- Steep Learning curve
- Pure control
- Cumbersome multitasking
- Convenient remote access
- Faster performace and uses less resources
Graphic User Interface (GUI):
- Ease of use and intuitive
- Easy multitasking
- Bulky remote access
- Slower
- Uses more resources
//==========================================================
SHELL BASICS:
<up arrow>: previous command
<tab>: auto complete
cd ../: is going into the upper level in the folder hierarchy
~: is home directory (can set to whatever)
pwd: print working directory
cd: change directory
- ~ :home
- . :current dir
- / :root directory or separator
- .. :parent directory
mv: move/rename file
cp: copy a file
rm: remove a file
- r flag: directory
mkdir: make a directory
ls: display files and directoried in current directory
- d flag: only list directories
- a flag: list all files including hidden ones
- l flag: show long listing including permissio ninfo
- s flag: show size of each file in blocks
sudo: execute command as master user
ln: create link
- hard links: to physical data (direct point to data; immune to changes since direct to data)
- A normal file is considered as a hard link to data, so with a file default will be 1 hard link
- symbolics links to file (-s) (points to file that points to data; changing original messes up soft link)
touch: update access and modify time to current time
- touch filename
- touch -t 201101311759.30 filename (set access and modification time to 2011 January 31 time 17:59:30)
cat: shows contents of a file
find: finds a file and return the path of the target file
- -name: name of the file
- -perm: permission of a file
- -user: owner of a file
- -maxdepth: hoe many levels to search
RegExp: find . -name "file1*" if you only know the file1 part of the filename (* is like a placeholder in regex)
Man: manual page
- hit q to exit
------------------------------------------------------------------------------------------------------------------
LINUX FILE PERMISSIONS:
Ordering of Permissions:
next 3 are user permissions
next 3 are group permissions
last 3 are for everyone else
Then number of hard links
User name
group name
size
date/time last modified
filename
R: readable
W: writeable
E: executable
chmod: add permissions to a file; chmod to a file affects the hard link permissions as well, not soft link's though...
Each digit corresponds to the 3 sections of permission: user, group, other (___):
- 0: nonde
- 1: execute only
- 2: write only
- 3: write and execute
- 4: read only
- 5: read and execute
- 6: read and write
- 7: full
//==========================================================
Everything is either a file or process
- Process: an executing program identified by PID
- File: collection of data
- Document
- Text of program
- Executable
- Directory
- Devices
Libraries and such will go to other top leverl directories
Absolute vs. Relative Path:
- Absolute path is always from root
- Relative path is from what directory we are in