Mastering navigating the Linux file system will fasten access specific file or folder. If the Linux OS come with GUI then you got no issue navigating using interface but if the Linux OS is minimal version then navigate using CLI is a must.
First you need to know directory parent and children. Example as below:
Type of Directory
Listing the Contents of a Directory with ls
The ls command lists the contents of the current directory.
Below show the lists content of home directory.
To show hidden files, use below command.
To include details such as the file/folder permissions, owner and group, size and the date and time, enter the following command:
Here the explanation of the listing newfile.txt
“-“rw-r–r– (refer to files)
Additional info: “d”rwxr-xr-x (refer to directory/folder)
Last access date/time
Mac 26 09:54
Another useful command as below:
As you can see the command scans and lists all the contents. The information can be lengthy but you can simplify by redirect the output to a text file. Example as below:
And here the output from the homedir.txt, I using command less for me go through page by page or line by line.
Changing Directories with cd
Use the cd command to move within the file system from one directory to another.
I do a ls command to show available directory. I want to change directory to Pictures, so I use command cd Pictures. You can see the change on my CLI view.
To move up to parent directory use the below command.
To return to home directory use the below command.
Another command below also help you to return to home directory.
Finding Your Current Directory with pwd
Use pwd to check the current directory you have access.
In previous post I share about Day-to-Day APT Usage, the apt command is a new version of apt-get command. It provide simplified because of no hyphen and included with progress bar. Both command work as it is.
Today, apt-get is used much more advanced package management task.
APT stand for Advanced Package Tool. APT also the first system to properly handle dependencies in software. If you want to install software like Libre Office, APT downloads Libre Office package and any other software it needs to work. APT also handles installation resuming if the internet connection is lose.
APT UPDATE & APT UPGRADE
APT uses a local cache of the available packages. Run the command below:
sudo apt update
As you can see APT will communicate with all the servers it is configured to use and download the latest list of file updates. If the list outdated, it will download the updates.
Next we can ask APT to automatically download any software that have been updated. Run the command below:
sudo apt upgrade
Below result the system already upgraded.
If the system is not upgrade, there will be a number of package that need to upgrade. It will show the download size of the package.
Remember, apt upgrade never removes software or adds new software!
If “0 not upgraded” status change, some things cannot be upgraded because of the update list didn’t satisfy the dependencies. In resolve this situation, we need to use apt dist-upgrade this allow to upgrade from one version of Debian/Ubuntu to a newer version.
This action is responsible for adding new software. For example, if I want to install MySQL database server. Here example command:
sudo apt install mysql-server
The output of the command tells:
All the dependencies required to install MySQL Server
There version that will install is MySQL-Server-8.0
There also suggested packages that can be install
Size the will be occupied on disk.
If the software/packages already installed, the apt install will be consider it as apt update and looks to see whether new versions are available for download.
The action is to remove the things that no longer want. The command as below:
sudo apt remove
Warning! Removing packages can be dangerous because APT also removes any software that relies on the packages that selected. Make sure to read the output carefully before proceed press Y to continue with the uninstall.
After the remove complete, the configuration files of the program is leave behind. If you reinstall, you don’t need to reconfigure it.
If want to remove the configuration file during the remove action, use below command:
sudo apt purge firefox
As you can see there is additional action perform by purge command. It will purging configuration files once the firefox is removed.
Like others operating system, Ubuntu also included the documentation with their system. This will help you to understanding the system and perform troubleshooting.
Using Man Pages
The man command followed by the name of command or program will show the manual pages. All the Man pages are stored in places like /usr/share/man and /usr/local/share/man, but to read a man page for ls command, use the man command as below:
Press enter and you will see the man page of ls command.
To scroll the page:
vertically – press arrow down/up
horizontally – press arrow right/left
next page – press spacebar
To search to, use the forward slash (/) and enter the string.
To quit man page, press q
If you like to have extensive manual page, use info command as below.
To navigate use the arrow keys and press q to quit reading.
Another helpful commands for accessing documentation, you can use the apropos command. Example as below:
The man -k command is provide same output as apropos.
Another handy command to find a command and its documentation. You can use the whereis command. Example as below.
The command output show the location of top command documentation. top command display Linux processes like CPU, RAM, running program/services.
Update and upgrade activities are to ensure the system received latest security and bug fixes either for operating system or application.
In this post, I will show how to perform and update and upgrade using command line.
Here the steps:
Click the menu at the bottom and at type terminal at the search box.
Click on Terminal.
Before that update/upgrade, record the details of the version and release.
To get those information use command below:
To get check the update, type below command
sudo apt update
Once the checking complete. You will see the number of packages can be upgraded.
To upgrade the software use command below:
sudo apt full-upgrade
The full-upgrade ensure that any-dependencies that needed will be installed, even if major changes are needed. You can also use the option upgrade even isn’t as smart as full-upgrade, but it might be a better choice on a production server because upgrade does not make major changes to software installations.
Below show the upgrade process is complete.
I run again the below command to check any changes on the version of operating system.
After verified, there is not changes after the full-ugprade action.
Ubuntu is an operating system based on the Linux kernel. Ubuntu released its first version in October 2004. Ubuntu itself is based on Debian. In this post, I will show on how to install Ubuntu 20.04 LTS.
In this post, I will share on how to create a new domain user. Normally when a new user joining the company, they will provided a username and password to login into the domain environment. This allow user to use that system or application of that company. Beside that company can monitor all the user activity in the domain environment.
Here the steps for create a new domain user:
Open Active Directory Users and Computers.
Expand the hadiyahyalab.com and select User.
Right Click > New > User
Complete the details required and click Next.
Complete the password section and select the parameter if needed.
The user is created. Click Finish.
Go to any joined computer in the domain and login with new user.