Linux various commands

# show only first line found:
grep "search this" nohup.out | sed -n '1p'
# show only last line found:
grep "search this" nohup.out | sed -n '$p'

# copy to current path the file /home/gigi/systemctl-services.txt 
# from adrhc.go.ro (remote ssh server) using custom ssh port 27
scp -P 27 gigi@adrhc.go.ro:/home/gigi/systemctl-services.txt .

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.