Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5266

Raspberry Pi OS • Re: Missing Bookworm 'rar' and 'unrar'

$
0
0
You do have to..

Code:

$ sudo apt-get install apt-file mlocate
..to get it (and 'locate') respectively. Also..

Code:

$ sudo apt-file update$ sudo updatedb
I tend to perform the 'apt-file update' as part of the "apt-get update/upgrade" process (in a script called 'svr-upd') and whilst "updatedb" automatically runs once per day (/etc/cron.daily/) I tend to run it manually (when I'm compiling stuff) because large swathes of files get created/disappear.

They have slightly different uses..

Code:

foo@pi23:~ $ type zramctlzramctl is /usr/sbin/zramctlfoo@pi23:~ $ which zramctl/usr/sbin/zramctlfoo@pi23:~ $ file $(which zramctl)/usr/sbin/zramctl: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=4bce014c9dee8c5db9324e6e759c8e5ace4b59a4, for GNU/Linux 3.7.0, stripped
This might make the distinction clearer..

Code:

foo@pi23:~ $ alias lcalias lc='ls -l'foo@pi23:~ $ which lc#(ie: no output)foo@pi23:~ $ type lclc is aliased to `ls -l'
..where 'lc' is one of a few commands I manually add onto the end of "/etc/bash/bashrc"..

Code:

foo@pi23:~ $ egrep lc /etc/bash.bashrcalias lc="ls -l"alias la="lc -a"alias ll="lc -trh"
Note that..

Code:

foo@pi23:~ $ type typetype is a shell builtinfoo@pi23:~ $ which type #(no output)foo@pi23:~ $ which which/usr/bin/which
..so 'type' is part of the (bash) shell and 'which' is an actual executable. You might desire to know this if you were (say) writing a script.

Wrt to 'awk' you can get a lot done knowing very little..

Code:

foo@pi23:~ $ echo "one two three" | awk '{print $1}' #first fieldonefoo@pi23:~ $ echo "one two three" | awk '{print $NF}'#last  fieldthreefoo@pi23:~ $ echo "one two three" | awk '{print $(NF-1)}' #last field minus one (second field)twofoo@pi23:~ $ echo "one two three" | awk '{print $2}' #second fieldtwo
Change the field separator char..

Code:

foo@pi23:~ $ echo "one two three" | awk -F',' '{print $1}'one two threefoo@pi23:~ $ echo "one,two,three" | awk -F',' '{print $1}'one
For no particular reason..

Code:

foo@pi23:~ $ apt-file search g++ | grep bin/ | egrep "^g\+\+:" | awk -F':' '{print $1 "=" $2}' | sed -e 's/[[:space:]]//g'g++=/usr/bin/aarch64-linux-gnu-g++g++=/usr/bin/g++foo@pi23:~ $ apt-file search g++ | grep bin/ | egrep "^g\+\+:" | awk -F':' '{print $1 " is" $2}'g++ is /usr/bin/aarch64-linux-gnu-g++g++ is /usr/bin/g++

Code:

foo@pi23:~ $ locate -i "bash.bashrc"/etc/bash.bashrc/etc/bash.bashrc.ORIGINAL/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc
Turns out I made a copy of that before my changes. What did I add?

Code:

foo@pi23:~ $ diff -u /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc--- /etc/bash.bashrc.ORIGINAL2022-03-27 19:40:30.000000000 +0100+++ /etc/bash.bashrc2023-09-21 11:17:10.367945246 +0100@@ -56,3 +56,15 @@ fi } fi+##+alias lc="ls -l"+alias la="lc -a"+alias ll="lc -trh"+alias pu="pushd 1>/dev/null"+alias po="popd 1>/dev/null"+alias j="jobs"+alias LS="ls --color=never"+alias LC="LS -l"+alias LA="LC -a"+export HISTTIMEFORMAT='%F %T ' HISTFILESIZE=2500+##
Turn the above back into something typeable..

Code:

foo@pi23:~ $ diff -u /etc/bash.bashrc.ORIGINAL /etc/bash.bashrc | egrep "^\+alias" | sed -e 's/\+//'alias lc="ls -l"alias la="lc -a"alias ll="lc -trh"alias pu="pushd 1>/dev/null"alias po="popd 1>/dev/null"alias j="jobs"alias LS="ls --color=never"alias LC="LS -l"alias LA="LC -a"
'sed' is a bit of a pig if I'm honest. Another day. ;-)

Statistics: Posted by swampdog — Thu Dec 05, 2024 9:58 am



Viewing all articles
Browse latest Browse all 5266

Trending Articles