Others, if they wish to, can also add their $0.02.
Moving Movie to USB (2.0)
Code: Select all
nice -n 20 mv Videos/Notting_Hill.mp4 /mnt/sdc2/Flm &
CAUTION Using mv name.* target/directory Found recently to my cost when moving bunch of old movies, that if for some reason you omit target/directory,
- one will be found for you:
Code: Select all
guest@porteus:~$ cat /proc/filesystems > Movie.mp4 # Movie of several hundred MB (for example) guest@porteus:~$ touch Movie.en.srt # Subtitle file of around 50 KB (for example) guest@porteus:~$ ls -l Movie.* -rw-r--r-- 1 guest users 0 Apr 19 22:09 Movie.en.srt -rw-r--r-- 1 guest users 268 Apr 19 22:24 Movie.mp4
- mv Movie.* [target/directory somehow omitted] expands with consequences:Move of several hundred MB was instantaneous, and subtitles file has vanished!
Code: Select all
guest@porteus:~$ mv Movie.* guest@porteus:~$ ls Movie.* Movie.mp4
- mv Movie.mp4 target/directory Moving Just the movie is almost instaneous, and further investigation reveals that one has ended up with a useless subtitles file
Code: Select all
guest@porteus:~$ mv Movie.* # had expanded to guest@porteus:~$ echo mv Movie.* mv Movie.en.srt Movie.mp4 guest@porteus:~$ ls -l Movie.mp4 -rw-r--r-- 1 guest users 0 Apr 19 22:09 Movie.mp4
- tgz
txz2xzm [/<Path to>/]<package>.tgzCode: Select all
root@porteus:/home/guest# txz2xzm gecko-mediaplayer-1.0.9-x86_64-1alien.tgz ... Creating /home/guest/gecko-mediaplayer-1.0.9-x86_64-1alien.xzm
- rpm
rpm2xzm [/<Path to>/]<package>.rpmCode: Select all
root@porteus:/home/guest# rpm2xzm p10/Por/tmp64/libicu-54.1-1.fc22.x86_64.rpm ... Creating /tmp/rpm2xzm2070/libicu-54.1-1.fc22.x86_64.xzm root@porteus:/home/guest# ls p10/Por/tmp64/libicu-54.1-1.fc22.x86_64.xzm -lh -rw-r--r-- 1 root root 8.7M Apr 5 13:44 p10/Por/tmp64/libicu-54.1-1.fc22.x86_64.xzm
Code: Select all
compgen -c | sort -u
Edit in Place: sed -idonald wrote:@ Bogomips
You can also use the bash built-in compgen
compgen -c will list all the commands you could run.
compgen -a will list all the aliases you could run.
compgen -b will list all the built-ins you could run.
compgen -k will list all the keywords you could run.
and many more....see the man pages..
Code: Select all
guest@porteus:~$ sudo sed -i 's/taper/bear/' /etc/usm/mirrors-alien.txt
guest@porteus:~$ cat /etc/usm/mirrors-alien.txt
# List of alien Slackware mirrors
# Structure: $VER/$ARCH
# NETHERLANDS
http://bear.alienbase.nl/mirrors/people/alien/sbrepos
Code: Select all
root@porteus:/home/guest# usm -u alien
Starting alien database update
Downloading: vercheck.txt DONE
Downloading: CHECKSUMS.md5.gz DONE
Downloading: MANIFEST.bz2 DONE
Downloading: PACKAGES.TXT.gz DONE
Downloading: LIBS.TXT.gz DONE
File verification was good.
Optimizing manifest
alien database updated.
Rava's cat trick (demonstrated for script to get version of package on the system)
cat > file
Data read from stdin
^D or ^C signifies end of data:
Code: Select all
cat > gsv
# Get Slackware Version
gsv ()
{
local s;
local t;
s=${1##*/};
s=${s%-*-*};
s=${s##*-};
s=$(expr "$s" : '\([0-9.]*\)');
s=${s%.};
t=${1##*-};
t=$(expr "$t" : '\([0-9]*\)');
echo $s-$t
}
# Version of Package on System
ver ()
{
local s;
local a;
local w=/var/log/packages/$1*;
for s in $w;
do
[[ "${s##*\*}" == "" ]] && return;
a=${s##*/};
[[ ${a%-*-*-*} != $1 ]] && continue;
echo $(gsv $s);
done
}
^D or ^C Terminates Input
Code: Select all
source gsv; # Needed just the once for a terminal tab
guest@porteus:~$ ver flashplayer-plugin
11.2.202.577-1
Initialising a File: echo -n > file
Code: Select all
guest@porteus:~$ cat /proc/filesystems > fs
guest@porteus:~$ ls -l fs
-rw-r--r-- 1 guest users 268 Apr 11 21:19 fs
guest@porteus:~$ echo -n > fs
guest@porteus:~$ ls -l fs
-rw-r--r-- 1 guest users 0 Apr 11 21:19 fs
donald wrote:"Initialising a File: echo -n > file"
or simply
> filename
I use it to quickly empty log files while they are in use.
e.g.
root@localhost:~# > /var/log/messages
8)
Code: Select all
guest@porteus:~$ cat /proc/filesystems > fs
guest@porteus:~$ ls -l fs
-rw-r--r-- 1 guest users 268 Apr 13 17:05 fs
guest@porteus:~$ >fs
guest@porteus:~$ ls -l fs
-rw-r--r-- 1 guest users 0 Apr 13 17:05 fs
Code: Select all
guest@porteus:~$ ls -l fs
-rw-r--r-- 1 guest users 0 Apr 11 21:19 fs
guest@porteus:~$ echo tmpfs on /dev/shm type tmpfs >> fs
guest@porteus:~$ ls -l fs
-rw-r--r-- 1 guest users 29 Apr 11 21:26 fs
guest@porteus:~$ cat fs
tmpfs on /dev/shm type tmpfs
Code: Select all
guest@porteus:~$ echo exec dbus-launch --exit-with-session /usr/bin/startxfce4 > fs
guest@porteus:~$ cat fs
exec dbus-launch --exit-with-session /usr/bin/startxfce4
COMPARE DIRECTORIES Update of: 15.09.2016
Code: Select all
diff -qr dir1 dir2
Code: Select all
guest@porteus:~$ diff -qr /mnt/sda4/cnrc_rc3/ /mnt/sda4/cin_rcp/ Only in /mnt/sda4/cin_rcp/etc/rc.d: rc.S Files /mnt/sda4/cnrc_rc3/etc/rc.d/rc.local and /mnt/sda4/cin_rcp/etc/rc.d/rc.local differ Only in /mnt/sda4/cin_rcp/etc/rc.d: rc.local_shutdown diff: /mnt/sda4/cnrc_rc3/etc/sudoers: Permission denied diff: /mnt/sda4/cin_rcp/etc/sudoers: Permission denied Only in /mnt/sda4/cin_rcp/home/guest/.config: geany Files /mnt/sda4/cnrc_rc3/home/guest/Prolog/pmx.sh and /mnt/sda4/cin_rcp/home/guest/Prolog/pmx.sh differ Files /mnt/sda4/cnrc_rc3/home/guest/Prolog/rc.local and /mnt/sda4/cin_rcp/home/guest/Prolog/rc.local differ Files /mnt/sda4/cnrc_rc3/home/guest/Prolog/rc_bak.local and /mnt/sda4/cin_rcp/home/guest/Prolog/rc_bak.local differ Files /mnt/sda4/cnrc_rc3/home/guest/Prolog/usm.conf and /mnt/sda4/cin_rcp/home/guest/Prolog/usm.conf differ Only in /mnt/sda4/cin_rcp/home/guest/Prolog: usm_rc4.conf
- Number of Files in Filesystem
Code: Select all
sudo find / -xdev -printf "\n" | wc -l
Code: Select all
guest@porteus:~$ sudo find /mnt/sda4 -xdev -printf "\n" | wc -l 132175 guest@porteus:~$ sudo find /mnt/sda8 -xdev -printf "\n" | wc -l 13 guest@porteus:~$ sudo find /mnt/sda8 -xdev -printf "\n" | od -cx 0000000 \n \n \n \n \n \n \n \n \n \n \n \n \n 0a0a 0a0a 0a0a 0a0a 0a0a 0a0a 000a
-
If running in Always Fresh mode (without saving changes), makes no sense to update a data base on the live system, especially if it means swap being used for this purpose, which means, in my case, the disk being accessed non-stop for 3 minutes or more, every once in a while. Avoid thus:which would best go in /etc/rc.d/rc.local
Code: Select all
# Suspend 'updatedb' rm /etc/cron.daily/slocate
- If strapped for ram, watching flash video using broadband connection, could mean flash using up all available ram for its cache, some 10-15 minutes into an hour long video.
Finally ascertained, with the help of the net, caching as taking place in /tmp. Redirecting /tmp to a real filesystem resolves issue:Above commands only needed if no suitable /tmp available on real filesystem.Code: Select all
mkdir /mnt/sdXy/Path/to/tmp chmod 1777 /mnt/sdXy/Path/to/tmp # Making a /tmp compatible directory.
Another point from the web was that redirection is best done before X starts. So eitherin /etc/rc.d/rc.local or append the boot parmeter cliexec=mount~--bind~/mnt/sdXy/Path/to/tmp~/tmp, the latter been using so far without incident.Code: Select all
mount --bind /mnt/sdXy/Path/to/tmp /tmp