Commands tagged arch linux (15)

  • An alternative to: python -m SimpleHTTPServer for Arch Linux source: http://archlinux.me/dusty/2010/01/15/simplehttpserver-in-python-3/ Show Sample Output


    6
    python3 -m http.server
    TheShadowFog · 2011-12-07 23:43:21 15
  • This one-liner will output installed packages sorted by size in Kilobytes. Show Sample Output


    4
    paste <(pacman -Q | awk '{ print $1; }' | xargs pacman -Qi | grep 'Size' | awk '{ print $4$5; }') <(pacman -Q | awk '{print $1; }') | sort -n | column -t
    BruceLEET · 2011-01-07 18:43:18 7
  • -Qdt Lists dependencies/packages which are no longer required by any packages -q Output only package name (not the version number) -R Remove package(s) Rest is self-explanatory. I just started out with Arch - so if there is any better/standard method to achieve the same - please suggest.


    4
    pacman -Qdt -q | xargs pacman --noconfirm -R
    b_t · 2014-02-27 05:17:57 8
  • Writes hybrid ISO directly to USB stick; replace /dev/sdb with USB device in question and the ISO image link with the link of your choice


    4
    wget -O /dev/sdb https://cdimage.ubuntu.com/daily-live/current/eoan-desktop-amd64.iso
    realkstrawn93 · 2019-09-19 04:03:13 114
  • Adding this alias to ~/.bashrc or, better yet, the system-wide /etc/bash.bashrc (as in my setup) will make it possible to not only run pacman as any user without needing to prepend sudo but will also ensure that it always assumes that the user knows what he or she is doing. Not the best thing for large multi-user enterprise setups at all to say the least, but for home (desktop) use, this is a fantastic time-saver.


    3
    alias pacman=‘sudo pacman --noconfirm’
    realkstrawn93 · 2021-12-28 20:29:13 565
  • If, while using a program, you get an error similar to: error while loading shared libraries: libusb-0.1.so.4: cannot open shared object file: No such file or directory Use pacman or pkgfile to search for the package that owns the missing library https://wiki.archlinux.org/index.php/General_troubleshooting#Message:_%22error_while_loading_shared_libraries%22 Show Sample Output


    2
    pacman -Fs libusb-0.1.so.4
    Mouath · 2019-03-07 16:15:10 35
  • The lastb command presents you with the history of failed login attempts (stored in /var/log/btmp). The reference file is read/write by root only by default. This can be quite an exhaustive list with lots of bots hammering away at your machine. Sometimes it is more important to see the scale of things, or in this case the volume of failed logins tied to each source IP. The awk statement determines if the 3rd element is an IP address, and if so increments the running count of failed login attempts associated with it. When done it prints the IP and count. The sort statement sorts numerically (-n) by column 3 (-k 3), so you can see the most aggressive sources of login attempts. Note that the ':' character is the 2nd column, and that the -n and -k can be combined to -nk. Please be aware that the btmp file will contain every instance of a failed login unless explicitly rolled over. It should be safe to delete/archive this file after you've processed it. Show Sample Output


    1
    sudo lastb | awk '{if ($3 ~ /([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}/)a[$3] = a[$3]+1} END {for (i in a){print i " : " a[i]}}' | sort -nk 3
    sgowie · 2012-09-11 14:51:10 4

  • 0
    pacman -Qi $(pacman -Qq)|grep 'Name\|Size'| cut -d: -f2 | paste - - | column -t | sort -nk2
    minus · 2011-05-03 13:02:06 4
  • M is size in megabytes, man expac to see other sizes %m is install size %k is download size


    0
    expac -S -H M "%m %n"|sort -n
    gtmanfred · 2012-06-14 19:41:21 3
  • I used this (along with a modified one replacing `mkv` with `srt`) to remove the slight differences in who the provider of the video / matching subtitle was (as they are the same contents and the subs match anyway). So now VLC (and other video players) can easily guess the subtitle file. Show Sample Output


    0
    perl-rename -v 's/720p.+mkv/720p\.mkv/' *.mkv
    benkaiser · 2014-09-25 14:07:47 9
  • This version accounts for the MiB/KiB suffix output by pacman these days.


    0
    pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | paste - - - | awk -F'\t' 'BEGIN{ s["MiB"]=1024; s["KiB"]=1;} {split($3, a, " "); print a[1] * s[a[2]], "KiB", $1}' | sort -n
    Timo · 2018-04-24 13:29:57 146

  • 0
    echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/dev/x86_64" | sudo tee -a /etc/pacman.conf
    HaoZeke · 2018-08-13 07:30:55 294
  • dmesg -t: no timestamp -W: follow new messages -l: log-level notice gawk if the fourth word is "Attached" echo a sentence through espeak


    0
    dmesg -tW -l notice | gawk '{ if ($4 == "Attached") { system("echo New device attached | espeak") } }
    BigZ · 2020-09-06 08:18:26 271

  • 0
    sudo pacman -Scc && pamac clean -b
    bugmenot · 2022-08-24 19:10:38 552
  • This, like the other commands listed here, displays installed arch packages. Unlike the other ones this also displays the short description so you can see what that package does without having to go to google. It also shows the largest packages on top. You can optionally pipe this through head to display an arbitrary number of the largest packages installed (e.g. ... | head -30 # for the largest 30 packages installed) Show Sample Output


    -1
    pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | paste - - - | awk -F'\t' '{ print $2, "\t", $1, "\t", $3 }' | sort -rn
    GetterNoCheddar · 2012-11-20 03:40:55 8

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

Transfer SSH public key to another machine in one step
This command sequence allows simple setup of (gasp!) password-less SSH logins. Be careful, as if you already have an SSH keypair in your ~/.ssh directory on the local machine, there is a possibility ssh-keygen may overwrite them. ssh-copy-id copies the public key to the remote host and appends it to the remote account's ~/.ssh/authorized_keys file. When trying ssh, if you used no passphrase for your key, the remote shell appears soon after invoking ssh user@host.

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.

Read aloud a text file in Mac OS X

Count number of files in a directory
Just want to post a Perl alternative. Does not count hidden files ('.' ones).

Download all PDFs from an authenificated website
Replace *** with the appropiate values

Multi-thread any command
For instance: $ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8 will encode all .wav files into FLAC in parallel. Explanation of xargs flags: -P [max-procs]: Max number of invocations to run at once. Set to 0 to run all at once [potentially dangerous re: excessive RAM usage]. -n [max-args]: Max number of arguments from the list to send to each invocation. -0: Stdin is a null-terminated list. I use xargs to build parallel-processing frameworks into my scripts like the one here: http://pastebin.com/1GvcifYa

disable caps lock
a quick one-line way to disable caps lock while running X.

Get a qrcode for a given string

Setting reserved blocks percentage to 1%
According to tune2fs manual, reserved blocks are designed to keep your system from failing when you run out of space. Its reserves space for privileged processes such as daemons (like syslogd, for ex.) and other root level processes; also the reserved space can prevent the filesystem from fragmenting as it fills up. By default this is 5% regardless of the size of the partition. http://www.ducea.com/2008/03/04/ext3-reserved-blocks-percentage/

Show apps that use internet connection at the moment.
show only the name of the apps that are using internet


Stay in the loop…

Follow the Tweets.

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.

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: