Make sure to make the terminal window the width of the full screen (~200 chars wide is good). Press 'd' to switch to delta mode and then every second it reports what was sent in the last second. You can use right and left arrow to see all columns if you can't make the terminal window wide enough.
nettop
find . -name "*.txt"
mdfind -name "gcc"
Get 12 samplings each 5 seconds long and list them.
sudo iotop -C 5 12
sudo killall top
mx3 is fast compression, but not super fast. mmt enables multithreading.
7z a -mx3 -mmt CoupledSubsOctTetB.7z CoupledSubsOctTetB
par2 create -v CoupledSubsOctTetB.7z
rsync without delete. Don't forget the slashes on the end of the directories!
rsync -avz source/ dest/
rsync with delete.
rsync -avz —delete source/ dest/
ln -s /full/path/to/original/file /full/path/to/link
pngpaste - | convert - -interpolate nearest -filter point -sample 50% - | imgcat
replace, -i does it in place.
sed -i 's/DenseScale=1/DenseScale=2/' CNN.py
If you want to change every occurence use:
sed -i 's/DenseScale=1/DenseScale=2/g' CNN.py
Remember the quoted text are regex so gotchas include / \ ' " . & * etc.
-ss is the start time. -to is the stop time. -c:v copy -c:a copy copies both video and audio streams.
ffmpeg -i "Input.mp4" -ss 00:21:29.00 -to 00:30:31.00 -c:v copy -c:a copy "Output.mp4"
find . -name '*.py' | up
Assume a directory with files t.001.jpg t.002.jpg etc. You want just 001.jpg 002.jpg etc.
rename 's/t.//' *
defaults write com.apple.finder CreateDesktop false killall Finder defaults write com.apple.finder CreateDesktop true killall finder
-r is for recursion -n is to list the file line numbers. --include says to only include the files which match the pattern.
grep -rn --include '*.py' import .
Allocation is in 512 byte blocks, so there are 2048 blocks in one megabyte. hdiutil is used to allocate GIGS gigabytes of RAM and attach it as an unmounted drive. That's passed to diskutil which formats it as an HFS+
GIGS=4; diskutil erasevolume HFS+ "RAMDisk" $(hdiutil attach -nomount ram://$((2048*1024*GIGS)))
First we need to convert the iso to a dmg which can be block-for-block written to the USB drive. Then we have to disk dump it to the USB drive. In the code below, replace the name values with appropriate disk or file names. In the final command, you must enter the size of the dmg into the pv command in the middle of the pipe. That is how it knows how far through the copy you are.
hdiutil convert -format UDRW -o [name].dmg [name].iso
diskutil list
diskutil eraseDisk FAT32 [NAME] GPT /dev/disk[n]
diskutil unmountDisk /dev/disk[n]
sudo dd if=/Users/Zack/Desktop/[name].dmg of=/dev/disk[n] bs=1m
dd if=[name].dmg ibs=1m | pv -s [size] | sudo dd of=/dev/disk[n] obs=1m
system_profiler SPDisplaysDataType
lmp_serial.exe -sf omp -pk omp 6 -in file.in
sf omp tells it to use OpenMP for algorithms that support it. pk omp tells it to tell the OpenMP package that it should use 6 threads.
python -m cProfile -s cumtime myscript.py > profile.txt
cat profile.txt
cProfile does the profiling, -s cumtime sorts the output by cumtime, and send the result to a text file.
srun --partition=etna --account=nano --ntasks=24 --time=01:00:00 --pty bash
bashtop = terminal resource monitor s-tui = stress test ui shows cores and temps hwinfo = data dump about all the hardware psensor = ui for graphing temps over time cpu-x = ui like cpu-z on linux.