Check These Out
Adds a function that runs every time the prompt is rendered. The function grabs the CWD from PWD and issues a command to tmux to change the current window
Simply more email-adresses matched
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)
Replace 'csv_file.csv' with your filename.
If you spend all day editing in vi then switching your fingers to Emacs mode just for the command line can be difficult. Use set -o vi in your bash shell and enjoy the power of a real editor.
The above code is just an example of printing on the same line, hit Ctrl + C to stop
When using echo -ne "something\r", echo will:
- print "something"
- dont print a new line (-n)
- interpret \r as carriage return, going back to the start of the line (-e)
Remember to print some white spaces after the output if your command will print lines of different sizes, mainly if one line will be smaller than the previous
Edit from reading comments: You can achieve the same effect using printf (more standardized than echo): while true; do printf "%-80s\r" "$(date)"; sleep 1; done
Using this command you can track a moment when usb device was attached.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
You could do the following, however, brace expansion with {} is not defined in POSIX, and therefore not guaranteed to work in all shells. But, if it does, it's more convenient (although it's certainly not less typing):
$ cp -r {*,.??*} /dest
Sometimes there are times when I need to cp(1), mv(1) or rm(1) files recursively, but don't want to traverse the previous directory by following ../../../../ etc out of the current directory. This command prevents that. The secret sauce is ".??*". The file globbing ensures that it must start with a dot, and be followed by at least two characters. So, three characters must exist in the filename, which eliminates "." and "..".