httrack
httrack "https://www.example.com" -O "<output_location>" -#L999999999 -disable-security-limits
-#LXXXX - Max urls
-disable-security-limits - No Connection speed limit
Tar
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
Here’s what those switches actually mean:
- -c: Create an archive.
- -z: Compress the archive with gzip.
- -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
- -f: Allows you to specify the filename of the archive.
tar cv <path-to_file-or-dir> | gzip -9 <dest-file-name>
utility cpu format size(bytes) gzip -9 0.02s gz 105,628 advdef -2 0.07s gz 102,619 7z -mx=9 -tgzip 0.42s gz 102,297 advdef -3 0.55s gz 102,290 advdef -4 0.75s gz 101,956 xz -9 0.03s xz 91,064 xz -3e 0.15s xz 90,996
Screen
screen -S file
Create a new screen session
screen -ls
List all session
screen -d 1643
Detach a screen sessiom (Ctrl+A+D for current session)
screen -r 1643
Reattach a screen session
Disk Usage:
sudo du -sh /var
Let’s explain the command and its arguments:
- The command starts with
sudo
because most of the files and directories inside the/var
directory are owned by the root user and are not readable by the regular users. If you omitsudo
thedu
command will print “du: cannot read directory”. s
- Display only the total size of the specified directory, do not display file size totals for subdirectories.h
- Print sizes in a human-readable format (h
)./var
- The path to the directory you want to get the size.
du -h /var/ | sort -rh | head -5
Split Large Files:
split [options] filename prefix
-l linenumber
-b bytes
Examples
- In this simple example, assume
myfile
is 3,000 lines long:split myfile
This will output three 1000-line files:
xaa
,xab
, andxac
. - Working on the same file, this next example is more complex:
split -l 500 myfile segment
This will output six 500-line files:
segmentaa
,segmentab
,segmentac
,segmentad
,segmentae
, andsegmentaf
. - Finally, assume
myfile
is a 160KB file:split -b 40k myfile segment
This will output four 40KB files:
segmentaa
,segmentab
,segmentac
, andsegmentad
.Split and combine:
split -b 100M Linux\ Security.mp4 ls.
cat ls.?? > Linux_security.mp4
FTP:
Below are some of the most common FTP commands
help
or?
- list all available FTP commands.cd
- change directory on the remote machine.lcd
- change directory on the local machine.ls
- list the names of the files and directories in the current remote directory.mkdir
- create a new directory within the current remote directory.pwd
- print the current working directory on the remote machine.delete
- remove a file in the current remote directory.rmdir
- remove a directory in the current remote directory.get
- copy one file from the remote to the local machine.mget
- copy multiple files from the remote to the local machine.put
- copy one file from the local to the remote machine.mput
- copy one file from the local to the remote machine.- passive - make connection passive
Post a Comment
Your feedback is welcome. Be it positive or negative. Please do not post any irrelevant comment or abuse anyway.