Difference between revisions of "CLI"
From Fiamma
Jump to navigationJump to search(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Various bash/zsh/CLI tips. | Various bash/zsh/CLI tips. | ||
+ | |||
+ | NB. This has been mostly superseded by [http://pchr8.net/d/dtb/|my Diensttagebuch], this remains for historical purposes or until I find a way to synchronize both. | ||
+ | |||
== Commands == | == Commands == | ||
=== Execute any line // echo any line from a textfile.=== | === Execute any line // echo any line from a textfile.=== |
Latest revision as of 21:27, 25 March 2020
Various bash/zsh/CLI tips.
NB. This has been mostly superseded by Diensttagebuch, this remains for historical purposes or until I find a way to synchronize both.
Contents
Commands
Execute any line // echo any line from a textfile.
Source: https://www.reddit.com/r/archlinux/comments/6k7go4/how_could_i_excecute_specific_commands_from_a/
sed -n 1p file.txt | bash
Turn screen off
https://wiki.archlinux.org/index.php/Display_Power_Management_Signaling
i3lock -c 000000 & xset dpms force off
Screen brightness
sudo tee /sys/class/backlight/radeon_bl0/brightness <<< 40
(out of 255/max_brightness)
Pull multiple files from Android via ADB using wildcards
Annoyingly the output of the adb shell ls command includes line-feed control characters that you can remove using tr -d '\r'.
Examples:
adb shell 'ls sdcard/gps*.trace' | tr -d '\r' | xargs -n1 adb pull adb shell 'ls /sdcard/*.txt' | tr -d '\r' | sed -e 's/^\///' | xargs -n1 adb pull
Suspend at ...
echo "systemctl suspend" | sudo at now +1 hour
From / other examples at: https://unix.stackexchange.com/questions/120506/how-to-shutdown-linux-at-a-specific-datetime-from-terminal/175601#175601
Backup everything in current directory + mysql database
tar cf backup_09062018.tar.gz . mysqldump --add-drop-table -u $user -p $pass > backup_09062018.sql
Programs
OpenVPN & writepid
Config line:
writepid /etc/openvpn/mv.pid
though
sudo openvpn --config mullvad_linux.conf --writepid /etc/openvpn/mv.pid
is better. In .i3status,
run_watch VPN { pidfile = "/etc/openvpn/mv.pid" } order += "run_watch VPN"
Network-manager replacement in Arch
nmtui
Pacman-wrapper for downloading faster
powerpill [1] (seems a bit like axel and apt-fast)
Speedtest
speedtest-cli
Resources
See also Category:CLI