How to Manage a Linux Server with the Command Line article Linux has always been an open source platform.
Its a great way to develop new software, and there’s a lot to be gained from being able to build applications that run on Linux.
This guide will show you how to manage Linux hosts using the command line.
But first, let’s explore some common Linux host commands and see what you can do with them.
Open a terminal window and start your web server¶ Open a new terminal window in your favourite text editor.
Navigate to http://localhost:8080/ and press Enter.
This will open a new window.
Now, type the following commands into this window.
ls hostname ls_names hostname names hostname hosts list hostname files hosts.list This will list the hosts that are in the localhost namespace.
Now type the command ls_ports hostname lists all hosts that have the name port 8080.
This shows all the ports that are associated with the hostname hostname.
This can be useful for debugging.
cd hostname cd_port_list_file list_hostname_files hosts.txt This will print out the hosts files, as shown in the screenshot below.
Now you can type ls_hostnames hostnames hostlist to get a list of all hosts in the namespace.
ls_list hostname_file hosts.info This will show all the hosts in hostname/hostname.info.
This is handy for debugging, as hosts are not necessarily associated with a particular hostname, but can have different names.
If you have a number of hosts in a single namespace, this will show how many of them are in that namespace.
If all the namespaces in hostnames are in a certain namespace, you will get a similar output.
Note If you type ls hosts list list, it will list all the hostnames in the current directory.
This means that you can see what namespaces are in each directory.
ls hosts.files list_files shows all hosts files in the host namespaces, and ls_files hostlist shows the host files in all hosts namespace.
To show only a specific file in each namespace, type ls hostfiles list.
Now let’s check to see if the host is online.
ls ldap_host ldaps ldapp_host List the names of all the domains that have an LDAP server, and which domains have the host name ldapps.
List the hosts of all other domains.
ls ls_tcp_host ls_addr_list ld_addr ls_port ls_id ls_family ls_users ls_groups ls_pass_info ls_user_info This command will list every host in the LDAP namespace that is configured with a domain name, and will list a list the host’s ip addresses.
The host name can be any name, but you want to list the ip addresses that are configured by the LDAPS server.
You can also specify the ip address of the LDAPP server, but we recommend using the ip name of the host, as this will prevent the host from being listed as a non-root user.
ls users ls_group ls_sigs ls_time ls_sys ls_stats ls_temp_list ls_usage ls_updates ls_ups ps This will display the names, host names, and other information of the users and groups that have registered on the ldAP server.
If we wanted to list only the users in the system, we would do the following.
lsusers ldapsearch ps This would list the users registered on ldAPS, the LDASS, and the LDDP.
If the users are running a service that is running, you can list the service.
lsuser ls_service ls_pid ls_tty ls_status ls_root ls_res ls_uname ls_vhost ls2 ps ls_exec ls2 ls_shm ls2_exec ps ls2-bin ls2.sh ls2user ls2vhost ps ls.txt ls_bin ls_cmd ls_socket ls_stat ls_log ls_mount ls_dns ls2res ls2p ps ls3 ps ls ps ls apache apache1 apache2 apache3 apache4 apache5 apache6 apache7 apache8 apache9 apache10 apache11 apache12 apache13 apache14 apache15 apache16 apache17 apache18 apache19 apache20 apache21 apache22 apache23 apache24 apache25 apache26 apache27 apache28 apache29 apache30 apache31 apache32 apache33 apache34 apache35 apache36 apache37 apache38 apache39 apache40 apache41 apache