Source
less
tips
Shell redirection
-
Linux Sysadmin Basics 04
-
STDIN = 0
-
STDOUT = 1
-
STDERR = 2
-
>
redirects STDOUT to file - OVERWRITES
-
>>
redirects STDOUT to file - APPENDS
-
|
redirects STDOUT from one program to STDIN of another program
-
<
redirects file or output to STDIN
Changing sudo group
Changed admin group from sudo to wheel - to get rid of the annoying home directory file (.sudo-as-admin-successful
)
SSH tunneling / port forwarding
- where to run command: local machine
XXXX
: port on local host
localhost
: local ip you’ll type into address bar (just use localhost
)
YYYY
: listening port on ssh server / remote machine
username@ZZZ.ZZZ.ZZZ.ZZZ
: remote server user and ip / domain name
example:
Learning git
fixing “repo within a repo”:
Using spaces in bash aliases
you have to escape slashes that escape spaces within the alias quotes:
- e.g.
obs="cd /mnt/c/Users/User/OneDrive\\ -\\ Company\\ Inc/..." \
EOF