Unix tool tip

6.3K posts

Unix tool tip banner
Unix tool tip

Unix tool tip

@UnixToolTip

Tips on Unix utilities and related topics from @JohnDCook.

Katılım Ağustos 2011
19 Takip Edilen83.3K Takipçiler
Sabitlenmiş Tweet
Unix tool tip
Unix tool tip@UnixToolTip·
'The enjoyment of one's tools is an essential ingredient of successful work.' -- Donald E. Knuth
English
12
337
626
0
Unix tool tip
Unix tool tip@UnixToolTip·
Emacs search, ignoring punctuation or spaces between words: M-s w
English
0
0
6
1.4K
Unix tool tip
Unix tool tip@UnixToolTip·
In Emacs, you can delete all but one space with M-x just-one-space. Typically bound to M-SPC (Alt-Space).
English
0
0
7
2.4K
Unix tool tip
Unix tool tip@UnixToolTip·
sed script to delete last line of a file: $d
English
0
2
11
1.6K
Unix tool tip
Unix tool tip@UnixToolTip·
List files in descending order of size: ls -S
English
0
0
9
1.6K
Unix tool tip
Unix tool tip@UnixToolTip·
Show which lines are repeated in a sorted file: uniq -d
English
0
0
16
2.2K
Unix tool tip
Unix tool tip@UnixToolTip·
'It is easier to port a shell than a shell script.' -- Larry Wall
English
0
1
20
2.5K
Unix tool tip
Unix tool tip@UnixToolTip·
sed pattern for lines not containing spam: /spam/!
English
0
1
8
1.6K
Unix tool tip
Unix tool tip@UnixToolTip·
Show how many times each line in a sorted file is repeated: uniq -c
English
0
0
13
1.6K
Unix tool tip
Unix tool tip@UnixToolTip·
The sed command p prints. For example, print lines 3 through 7 of a file: sed -n '3,7p' somefile
English
1
0
15
1.4K
Unix tool tip
Unix tool tip@UnixToolTip·
Sort a file in case-insensitive order: sort -f. 'f' for 'fold,' i.e. fold upper and lower case together
English
0
0
11
1.3K
Unix tool tip
Unix tool tip@UnixToolTip·
Kill a line in Emacs from anywhere on that line: M-shift-backspace
English
0
0
7
1.7K
Unix tool tip
Unix tool tip@UnixToolTip·
Output a file, displaying non-printing characters: cat -v
English
0
1
13
1.7K
Unix tool tip
Unix tool tip@UnixToolTip·
In vim, ^ takes you to the first non-blank character of a line. In sed, ^ refers to the first line of a file. In regex, ^ matches the beginning of a string.
English
0
0
1
708
Unix tool tip
Unix tool tip@UnixToolTip·
Similarly, in bash !^ refers to the first argument to the previous command. This makes sense because ! refers to commands and ^ often refers to the beginning of something.
English
1
0
4
706
Unix tool tip
Unix tool tip@UnixToolTip·
In bash !$ refers to the last argument to the previous command. Example usage: copying a file to a directory and then cd'ing into that directory cp some_file.txt big/long/complicated/path/to/directory cd !$
English
1
0
19
4.3K