- soft link
- Shorcuts to quickly move the cursor around the current line
- The Difference Between Soft and Hard Links
- Symbolic (soft) links
- Save your scripts on...
- How to use sed to replace strings in macos
- Create an hyperlink command line
1. soft link
ln -s /pathDirectorySource /PathDirectoryWhereYouWantTheLink
Enable Meta key. Open Terminal > Preferences > Settings > Keyboard, and enable Use Option as meta key.
- ctrl-A: Go to beginning of the line.
- ctrl-E: Go to the end of the line.
enable Metadata Key, then you can use:
- alt-f: Go forward one word
- alt-b: Go backwards one word -> Very useful
# Hard links
- Only link to a file not a directory
- Can not reference a file on a different disk/volume
- Links will reference a file even if it is moved
- Links reference inode/physical locations on the disk
- Can link to directories
- Can reference a file/folder on a different hard disk/volume
- Links remain if the original file is deleted
- Links will NOT reference the file anymore if it is moved
- Links reference abstract filenames/directories and NOT physical locations. They are given their own inode
Example 1:
$ ln -s /Users/carlossantiagocruz/Documents/BASH-PROGRAMMING/DICT-EN-ES/trad3.sh /usr/local/bin/trad3
Example 2:
ln -s /Users/carlossantiagocruz/Documents/BASH-PROGRAMMING/MOVER-PDF-2-DIRECTORIO/mover-pdf2directorio.sh /usr/local/bin/mover-pdf2directorio1.0
Create a bin directory on your home directory
mkdir bin
Using echo
echo -e '\e]8;;http://example.com\aThis is a hyperlink\e]8;;\a'
Using printf
printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'
The following files are used by Unix process.
ls -l /dev/{stdout,stdin,stderr}
COnsole output:
lr-xr-xr-x 1 root wheel 0 Nov 26 16:33 /dev/stdout -> fd/1
lr-xr-xr-x 1 root wheel 0 Nov 26 16:33 /dev/stdin -> fd/0
lr-xr-xr-x 1 root wheel 0 Nov 26 16:33 /dev/stderr -> fd/2
/dev/stdin
( 0 ) – Standard Input (usually keyboard or file). When a command opens/dev/stdin
, it can read input from the user./dev/stdout
( 1 ) – Standard Output (usually screen). When a command writes to/dev/stdout
, its output is displayed on the screen./dev/stderr
( 2 ) – Standard Error (usually screen). When a program or command writes to/dev/stderr
, its error messages are displayed on the screen.
/dev/null
discards data in Unix systems. Used to suppress program output.
command1 >/dev/null # redirects standard output to /dev/null
command1 >/dev/null 2>&1 # redirects standard output to /dev/null, 2>&1 operator redirects standard error to the same location as standard output.