Skip to main content

Posts

Showing posts from October, 2026

How to move files in Linux using ls?

Moving files to organize or to simply archive is part of a sysadmin life. In Linux, ls -1 (number one not small letter L) command means list the files but only show the filenames. The output of ls -1 can be utilized as an input to mv to move the files, since mv requires a filename to be move plus a destination where to move the files. Here's a simple command to do it with a few parameters of course:          ls -1 | xargs -d '\n' -I {} mv -- {} /path/to/destination/ Above move whatever files it can find on the path; where the command is run and it's a command that will also move files even though it has space or tab on the filename of the files. Below is a revised command to move all .txt files on the current directory or on the path where the command is executed.          ls -1 *.txt | xargs -d '\n' -I {} mv -- {} ./archive_folder/ The mv --, the -- is a safety precaution or a mechanism in order not to misinterpret any filenames wi...

Linux Top check a single process

Monitor a single process in Linux, to check if the process is the culprit,.or just simply monitor the resources consume by the process in real time. This can be done easily using Linux, top and pgrep commands Example: Check MySQL daemon. Open terminal and type this:    top -p $(pgrep -f mysqld )  It will display top with only mysqld displayed on the screen. That's it you can monitor the process, observe what it's doing. Till next time, enjoy exploring the command line, Happy Linuxing... Prayer is free, brings comfort to your life. Trust Jesus He will guide you to righteousness. https://soulrefresh.netlify.app