Laboratory building study notes --linux

2 ## basic commands

#echo "input a text" | tr '[az]' '[AZ]' # standard input output lowercase to uppercase

 

#col Tab command may be replaced by an equal number of key spaces, or reverse this operation.

# View invisible characters / etc / protocols in, you can see a lot of ^ I, which is actually visible symbol Tab escaped as character

$ Cat -A / etc / protocols # col -x will use the / etc / protocols in Tab converted to spaces, then use cat to see, you ^ I find missing

$ cat /etc/protocols | col -x | cat -A

 

Cd $ / Home / shiyanlou # creates two files

$ echo '1 hello' > file1

Echo $ '. 1 shiyanlou'> file2

$ The Join # file1 file2 the / etc / passwd and / etc / shadow merge two files, to specify the ':' as a separator

The sudo $ the Join -t ':' / etc / passwd / etc / Shadow # the / etc / passwd and / etc / group file merge two, in order to specify the ':' as a separator, respectively, over the first 4 and 3 field

$ sudo join -t':' -1 4 /etc/passwd -2 3 /etc/group

 

pasteThis command is join a command similar, it is without comparison data is simply combined with a plurality of files, in Tabspaced apart.

$ echo hello > file1

$ Echo shiyanlou> file2

$ echo www.shiyanlou.com > file3

$ paste -d ':' file1 file2 file3

$ Paste -s file1 file2 file3

Guess you like

Origin www.cnblogs.com/gzhm/p/12175432.html