git
command using git help commit
or alternatively view the Git User Manual and git-scm Documentation-s
option with each commit adds a Signed-off-by: entry required when using DCO to document code contributions.git gui
provides a graphical interface to git
.mkdir gitdir
cd gitdir
git init
ls -l .git
echo "This is testfile1" > testfile1.txt
echo "This is testfile2" > testfile2.txt
git add .
git status
git config --global user.name "Richard Hudson"
git config --global user.email "richard.b.j.hudson@gmail.com"
Note: You may omit the --global
option to set on a per repository basis.
echo "Line2" >> testfile1.txt
cat testfile1.txt
git diff testfile1.txt
git add testfile1.txt
git status
git commit -m "Initial commit"
git status
Note: You may sign off a git commit using git commit -m "Initial commit" -s
.
git log
.git checkout -b main
git branch
git branch -d master
git branch
git checkout master
git branch -m master main
git push -u origin main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
git branch -a
Note: You could simply create a new main branch and then ignore the master branch.
systemctl
displays everything that systemd controls.systemctl list-units -t service
.systemctl status apache2
is used to display the status of a service.sudo systemctl [start/stop/restart] apache2
and reload its configuration using sudo systemctl reload apache2
.systemctl [enable/ disable] apache2
is used to set a service to start at boot time.Command | Description |
---|---|
journalctl -u ssh | Query the systemd journal for a service. |
tail -f /var/log/syslog | Some daemons may not have their own log file and may place logs in syslog. |
dmesg | Useful to see hardware issues logged at the kernel level. |
Command | Description |
---|---|
htop | Interactive process viewer with mouse support. |
pstree | Display a tree of processes and highlights targeted PID. |
ps -elf | Report a snapshot of the current processes. |
uptime | Tell how long the system has been running. |
Command | Description |
---|---|
free -h | Display amount of free and used memory in the system. |
vmstat | Report virtual memory statistics. |
/var/log
.help ulimit
may be used to provide control over the resources available to the shell and processes.
/etc/security/limits.conf
.df -Th
displays filesystem usage with its type and human readable size.du -hsc *
.df -i
displays the number of inodes (metadata describing stored data) in use. A filesystem may report as full if an inode limit is hit. You would need to delete files to reclaim inodes.ncdu -x /var
provides a tree view of your filesystem and D allows you to delete the selected file or directory.