Tuesday, September 20, 2016

Linux - Bash - Pointing to currentdirectory when using command


Current directory: . Example : mv file.txt .

Home directory: ~

If we want to print this directory we use the pwd (print working directory)


For instance if we are in /mydir

and we want to 7zip this dir then 
7z a Nameofzip ./

./ will then point to /mydir



R  W   X
4 +2 +1  = 7

chmod -o+w file/dir

(U+G+O) = User Group Other

Octal notation

You may read or set permissions using a 3 digit octal number. The digits represent the owner, group, and other permissions, from left to right. Each digit may be 0 through 7 representing the different combinations of read, write, and execute.
To compute what each digit means, use this formula.
read/r = 4
write/w = 2
execute/x = 1

For each permission you want to grant, sum their corresponding values.


Toogle Jobs

ctrl + z - Cancel current job/task.
jobs  - list current running jobs/task.
fg #number select current job/task.


Kill process:

list : ps -aux.
ps -aux | grep something.
kill -STOP or -TERM or -KILL


No comments:

Post a Comment