mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 13:42:11 +01:00
Add cheatsheet for paste.
This commit is contained in:
parent
e9b8f04c24
commit
afcd74c8bf
1 changed files with 15 additions and 0 deletions
15
cheat/cheatsheets/paste
Normal file
15
cheat/cheatsheets/paste
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Concat columns from files
|
||||||
|
paste file1 file2 ...
|
||||||
|
|
||||||
|
# List the files in the current directory in three columns:
|
||||||
|
ls | paste - - -
|
||||||
|
|
||||||
|
# Combine pairs of lines from a file into single lines:
|
||||||
|
paste -s -d '\t\n' myfile
|
||||||
|
|
||||||
|
# Number the lines in a file, similar to nl(1):
|
||||||
|
sed = myfile | paste -s -d '\t\n' - -
|
||||||
|
|
||||||
|
# Create a colon-separated list of directories named bin,
|
||||||
|
# suitable for use in the PATH environment variable:
|
||||||
|
find / -name bin -type d | paste -s -d : -
|
Loading…
Reference in a new issue