Useful use of cat(1)
in-ulm.de
Useful use of cat(1)
1–10 of 46 posts
Re: Useful use of cat(1)
#2Re: Useful use of cat(1)
#3 cat > file vs. touch file
cat file | cmd vs. cmd
So even some of the thing listed are still not the best use case for catRe: Useful use of cat(1)
#4You may also create new empty files by saying `touch filename`. This saves three keystrokes (which includes an annoying `>` symbol, requiring the shift key) as compared to the aforementioned `cat` method!
>foo
also works to create file "foo".Re: Useful use of cat(1)
#5 cat - | grep "something"
And control-d when finished entering textRe: Useful use of cat(1)
#6You may also create new empty files by saying `touch filename`. This saves three keystrokes (which includes an annoying `>` symbol, requiring the shift key) as compared to the aforementioned `cat` method!
Re: Useful use of cat(1)
#7Re: Useful use of cat(1)
#8You may also create new empty files by saying `touch filename`. This saves three keystrokes (which includes an annoying `>` symbol, requiring the shift key) as compared to the aforementioned `cat` method!
Or, at least when running Bash (possibly sh, didn't try), just >foo also works to create file "foo".
:>foo
(the happy file creation operator) does.Re: Useful use of cat(1)
#9cat > file vs. touch file cat file | cmd vs. cmd So even some of the thing listed are still not the best use case for cat
With 'cat > file' you can actually type in the file's contents (then press ^d to finish). 'touch file' merely creates an empty file. (Not that I think 'cat > file' is much faster than 'vi file')
Re: Useful use of cat(1)
#10 $ echo $COLUMNS
118
$ ps -fp 14706
UID PID PPID C STIME TTY TIME CMD
root 14706 14705 0 Jan29 pts/3 00:00:00 sudo -p [local sudo] Password: python /usr/lib/sshuttle/main.py pytho
$ ps -fp 14706 | cat
UID PID PPID C STIME TTY TIME CMD
root 14706 14705 0 Jan29 pts/3 00:00:00 sudo -p [local sudo] Password: python /usr/lib/sshuttle/main.py python -v --firewall 12300 0