https://www.commandlinefu.com/commands/browse Toggle navigation COMMANDLINEFU.COM * +New * Commands + Latest + All-time Greats + Hot this month + The Wicked + Random * Login [tag-loader] [ ] [INS::INS] All commands (14,164) [all time ] sorted by [date ] * Create a square thumbnail or favicon using ImageMagick Resize `file.png` to a 32x32 px image. Use a value other than 32 to create other icon sizes (e.g. 16x16 or 32x32). Combine two favicon sizes using: `convert icon-16px.png icon-32px.png favicon.ico` For a social media preview image, use `2:1#` for the extent and `1200` for the scale. This is sample output - yours may be different. 2 convert file.png -background transparent -gravity Center -extent 1:1# -scale 32 file-32px.png lgarron * 2023-03-08 04:11:12 148 + Submit alternative + + Report as malicious + Report as a duplicate * Gentoo, print in percent of all available packages in tree we installed This is sample output - yours may be different. 1 echo "$((`eix --only-names -I | wc -l` * 100 / `eix --only-names | wc -l`))% of 100% packages from Gentoo Linux is installed" wuseman1 * 2023-03-03 22:27:45 126 + Submit alternative + + Report as malicious + Report as a duplicate * List all files in a folder in a git repository by last commit date This lists all the files in a folder, then finds the commit date for them one by one, then sorts them from newest to oldest This is sample output - yours may be different. 1 git ls-tree --name-only HEAD foldername/ | while read filename; do echo "$(git log -1 --format="%ci " -- $filename) $filename"; done | sort -r fivestones * 2023-03-01 17:02:51 44 + Submit alternative + + Report as malicious + Report as a duplicate * A Console-based Audio Visualizer for ALSA # Installing apt search cava sudo apt install cava # modify the default config to change the colors by their hex color code cava -p mkdir ~/.cava nano ~/.cava/config cava # run with changes! This is sample output - yours may be different. -2 cava ioshield * 2023-02-28 19:53:42 80 + Submit alternative + + Report as malicious + Report as a duplicate * Speak & Spell-esque glitch sounds The Speak & Spell's sound chip uses a compressed audio format called "linear predictive coding". This command will read random bytes and attempt to decompress them as if it were audio data compressed in this format, then play it. This results in a unique sound which is similar to a glitching Speak & Spell. This is sample output - yours may be different. 0 play -tlpc /dev/urandom Sparkette * 2023-02-16 22:28:16 198 + Submit alternative + + Report as malicious + Report as a duplicate * Bypass with hexencoding, dump /etc/passwd This is sample output - yours may be different. 1 cat $(echo -e "\x2f\x65\x74\x63\x2f\x70\x61\x73\x73\x77\x64") wuseman1 * 2023-01-14 06:43:27 676 + Submit alternative + + Report as malicious + Report as a duplicate * List all files and folders with attributes This is sample output - yours may be different. -2 gci -rec | Select-Object Mode, Name, CreationTime, LastAccessTime, LastWriteTime | ft -autosize swarzynski * 2022-12-07 13:24:42 776 + Submit alternative + + Report as malicious + Report as a duplicate * Copy a file with progress and save hash to a different file This is sample output - yours may be different. 4 pv file.txt | tee >(sha1sum > file.sha1) > file-copy.txt bugmenot * 2022-11-24 20:23:02 541 + Submit alternative + + Report as malicious + Report as a duplicate * AWS s3api CLI can be used to filter objects in a S3 bucket based on the Last Modified Date using the --query filter. as explained in the blog post: https://www.learnaws.org/2022/10/ 10/aws-s3-list-files-date/ This is sample output - yours may be different. -2 aws s3api list-objects-v2 --bucket my-bucket --query 'Contents[? LastModified>`2022-01-01`].Key' shantanuo * 2022-11-22 07:57:44 411 + Submit alternative + + Report as malicious + Report as a duplicate * Unzip 25 zip files files at once This is sample output - yours may be different. 2 find . -maxdepth 1 -name '*.zip' -print0 | xargs -0 -I {} -P 25 unzip {} wuseman1 * 2022-11-20 14:07:44 286 + Submit alternative + + Report as malicious + Report as a duplicate * Convert an image sequence into a video This is sample output - yours may be different. 4 ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out.mp4 alikhalil * 2022-11-14 07:20:53 415 + Submit alternative + + Report as malicious + Report as a duplicate * MySQL: Filter out specific tables from an existing mysqldump file with awk This command works only if the line "DROP TABLE IF EXISTS" exists for all tables in the mysqldump file. It acts like a state machine. This is sample output - yours may be different. 0 cat db_dump.sql | awk '/DROP TABLE IF EXISTS/ { skip = $5 ~ / table1|table2/ } !skip { print $0 }' > db_dump_filtered.sql stf42 * 2022-10-30 16:58:57 671 + Submit alternative + + Report as malicious + Report as a duplicate * How To Display Bash History Without Line Numbers userful for direct copy & paste command for doumenation or next using Show Sample Output This is sample output - yours may be different. systemctl restart docker docker system prune -a vim /etc/docker/daemon.json hostname -f hostname cl-docker01 vim /etc/hostname hostname --help hostnamectl --help hostnamectl set-hostname cl-docker01 hostnamectl status chown -R ghost:ghost /mnt/vda3 chown -R ghost:ghost /mnt/vda3/ groupadd docker usermod -aG docker ghost su -s ghost vim /etc/ssh/sshd_config /etc/init.d/ssh restart ls /mnt/vda3/ docker info docker ps apt install net-tools history mkdir /source id ghost 2 history -w /dev/stdout aysadk * 2022-10-29 15:17:37 557 + Submit alternative + + Report as malicious + Report as a duplicate * merge multiple jpgs to one picture vertikal # convert tool is from deb imagemagick-6.q16 apt install imagemagick-6.q16 Show Sample Output This is sample output - yours may be different. Output_merged_picture.jpg 2 convert picture-1.jpg picture-2.jpg picture-3.jpg -append Output_merged_picture.jpg aysadk * 2022-10-25 15:34:48 360 + Submit alternative + + Report as malicious + Report as a duplicate * Start monitoring your server with a single curl command. activate the first alert and the next ones are activated automatically. Show Sample Output This is sample output - yours may be different. ATTENTION!!!: there is a new domain name! # start monitoring your server with a single curl command. curl ping.gl/me@example.org/104.28.13.51 # activate the first alert and the next ones are activated automatically. curl ping.gl/me@example.org/example.org # you can skip the IP if you run it from the server, watch out for proxies, etc. curl ping.gl/me@example.org # create an HTTP or HTTPS status check specifying a full URL instead of a host. curl ping.gl/me@example.org/https://example.org 0 curl ping.gl wuseman1 * 2022-10-15 13:24:45 433 + Submit alternative + + Report as malicious + Report as a duplicate * Show a zoomable world map show a zoomable world map This is sample output - yours may be different. 7 telnet mapscii.me wuseman1 * 2022-10-15 13:15:17 338 + Submit alternative + + Report as malicious + Report as a duplicate * List all packages in Ubuntu/Debian that no package depends on This is sample output - yours may be different. 2 dpkg-query --show --showformat='${Package}\t${Status}\n' | tac | awk '/installed$/ {print $1}' | xargs apt-cache rdepends --installed | tac | awk '{ if (/^ /) ++deps; else if (!/:$/) { if (!deps) print; deps = 0 } }' swarzynski * 2022-09-29 07:55:16 480 + Submit alternative + + Report as malicious + Report as a duplicate * Print nic name of current connection This is sample output - yours may be different. 2 nmcli -g name,type connection show --active|awk -F: '/ethernet| wireless/ { print $1 }' wuseman1 * 2022-09-22 20:16:21 471 + Submit alternative + + Report as malicious + Report as a duplicate * Simple tar Simple commant to tar a path This is sample output - yours may be different. -3 tar -cvzf file.tar.gz path x3mboy * 2022-09-17 16:40:09 409 + Submit alternative + + Report as malicious + Report as a duplicate * rclone - dump teamdrive config to config file This is sample output - yours may be different. 1 $ rclone backend -o your-config.conf drives mydrive: dbiesecke * 2022-09-09 15:58:16 325 + Submit alternative + + Report as malicious + Report as a duplicate * url redirect tracer with curl tracing redirects for a given url shortener Show Sample Output This is sample output - yours may be different. Location: https://www.shorturl.at/dfIJQ location: https://youtu.be/dQw4w9WgXcQ location: https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be 4 curl --silent -I -L shorturl.at/dfIJQ | grep -i location aysadk * 2022-09-04 19:31:46 402 + Submit alternative + + Report as malicious + Report as a duplicate * QEMU From Fedora Livecd + Device CD + Device Disk + UEFI + 800x600 forced Entire command: sudo qemu-system-x86_64 -enable-kvm -cpu host -M q35 -m 2G -smp 4 --bios /usr/share/edk2/ovmf/OVMF_CODE.fd -drive id=cdrom,file=/dev/sr1,if=none,media=cdrom,format=raw,readonly=on -drive id=disk,file=/dev/md126,if=none,format=raw -device virtio-blk-pci,drive=cdrom -device virtio-blk-pci,drive=disk -device VGA,vgamem_mb=64,xres=800,yres=600 This is sample output - yours may be different. -2 sudo qemu-system-x86_64 ... pqatsi * 2022-09-02 20:07:02 301 + Submit alternative + + Report as malicious + Report as a duplicate * Extend LVM and online resize filesystem Default volume group in Ubuntu is ubuntu-vg and the logical volume is ubuntu-lv, so the provided command will resize the disk to utilize 100% of the available space. Show Sample Output This is sample output - yours may be different. Size of logical volume ubuntu-vg/ubuntu-lv changed from <14.25 GiB (3647 extents) to <28.50 GiB (7295 extents). Logical volume ubuntu-vg/ubuntu-lv successfully resized. resize2fs 1.45.5 (07-Jan-2020) Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required old_desc_blocks = 2, new_desc_blocks = 4 The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 7470080 (4k) blocks long. 0 lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv && resize2fs /dev/ ubuntu-vg/ubuntu-lv sxiii * 2022-08-26 13:02:10 412 + Submit alternative + + Report as malicious + Report as a duplicate * Clean or clean pacman and pamac cache This is sample output - yours may be different. 0 sudo pacman -Scc && pamac clean -b bugmenot * 2022-08-24 19:10:38 306 + Submit alternative + + Report as malicious + Report as a duplicate * Sort disk usage from directories Sort disk usage from directories in the current directory Show Sample Output This is sample output - yours may be different. 4.0K ./jenkins_home 8.0K ./.docker 8.0K ./.gnupg 8.0K ./.oracle_jre_usage 12K ./.local 28K ./.config 36K ./.ssh 40K ./helm 140K ./.ansible 2.7M ./x3mboy 15M ./.cache 15M ./.kube 43M ./.krew 3.7G ./rancher 1 du --max-depth=1 -h . | sort -h x3mboy * 2022-08-23 14:58:57 304 + Submit alternative + + Report as malicious + Report as a duplicate * 1 2 3 > Last > What's this? commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down. Share Your Commands --------------------------------------------------------------------- Check These Out Convert seconds into minutes and seconds This is a very simple way to input a large number of seconds and get a more useful value in minutes and seconds. Show crontabs for all users This is flatcaps tweaked command to make it work on SLES 11.2 Install pip with Proxy Installs pip packages defining a proxy Get Cisco network information This gives you lots of nifty Cisco network information like VLAN tag, port and switch information. Which processes are listening on a specific port (e.g. port 80) swap out "80" for your port of interest. Can use port number or named ports e.g. "http" Write comments to your history. A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session. Pack up some files into a tarball on a remote server without writing to the local filesystem I recently found myself with a filesystem I couldn't write to and a bunch of files I had to get the hell out of dodge, preferably not one at a time. This command makes it possible to pack a bunch of files into a single archive and write it to a remote server. bash pause command Just added -sn1 -s = silent -n1 = only one symbol needed to continue after the insert remove oprhan package on debian based system Advanced python tracing Trace python statement execution and syscalls invoked during that simultaneously --------------------------------------------------------------------- Stay in the loop... Follow the Tweets. [twitter] Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted. >> http://twitter.com/commandlinefu >> http://twitter.com/commandlinefu3 >> http://twitter.com/commandlinefu10 Subscribe to the feeds. [rss] Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,...): Subscribe to the feed for: + >> all commands + >> commands with 3 up-votes (commandlinefu3) + >> commands with 10 up-votes (commandlinefu10) commandlinefu.com (c) 2018 Dan's Tools | FAQs | API | Widget | Privacy