mraza007 / blog

Currently hosted on vercel
https://blog-vert-iota.now.sh
MIT License
0 stars 0 forks source link

2021/Oneliners/ #2

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

My Favorite One Liners | Muhammad

Commandline one liners that makes your workflow more productive

https://muhammadraza.me/2021/Oneliners/

thisstillwill commented 3 years ago

Very cool!

terroo commented 3 years ago

Very good!

giannitedesco commented 3 years ago

If you want to cat bunch of files at once you can this command.

"cat" is short for "concatenate" and literally exists to do what this one liner is supposed to do ;)

You never need to cat a single file because you can just use redirection instead.

asiby commented 3 years ago

In order to real time terminal session, I use the following:

screen -S the-screen-name : To create a meeting room.

screen -x the-screen-name : To join a meeting room.

The screen command is available by default on most Linux based system.

I have used this for providing training sessions.

You can also force someone into a screen session as soon as they login and monitor what they are doing. This can be handy when you give someone access to your server and you don't want them snooping around.

increscent commented 3 years ago

I use this command to copy stdin to the clipboard: xclip -i -selection clipboard Then I add a bash alias for it: alias copy='xclip -i -selection clipboard'

So now I can type cat file.txt | copy and I have copied the file to my clipboard.

mraza007 commented 3 years ago

If you want to cat bunch of files at once you can this command.

"cat" is short for "concatenate" and literally exists to do what this one liner is supposed to do ;)

You never need to cat a single file because you can just use redirection instead.

Got it TIL cat stands for concatenate but thanks for pointing out

mraza007 commented 3 years ago

In order to real time terminal session, I use the following:

screen -S the-screen-name : To create a meeting room.

screen -x the-screen-name : To join a meeting room.

The screen command is available by default on most Linux based system.

I have used this for providing training sessions.

You can also force someone into a screen session as soon as they login and monitor what they are doing. This can be handy when you give someone access to your server and you don't want them snooping around.

Got it. So i have used screen in the past but mkfifo was something really new for me and it was something I recently discovered

mraza007 commented 3 years ago

I use this command to copy stdin to the clipboard: xclip -i -selection clipboard Then I add a bash alias for it: alias copy='xclip -i -selection clipboard'

So now I can type cat file.txt | copy and I have copied the file to my clipboard.

I'll definitely check this out

asiby commented 3 years ago

At the command line, you can set the CDPATH environment variable. It uses the same syntax as the PATH variable. And it is used when using the cd command. If the cd command does not find the folder in the current directory, it will look for it in one of the directories listed in CDPATH.

Example: CDPATH=:/home/asiby:/home/asiby/Documents

If there is a foo folder at /home/asiby/Documents/foo/

I can do this:

cd / cd foo pwd

The output will be /home/asiby/Documents/foo

The autocompletions that you get when pressing the tab key will also look in the paths provided by CDPATH.