Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, February 16, 2024

Installing Configuring Exploring Deepin in 15 Minutes




## #Deepin #Linux: Unveiling the Newest Features for a Sleek and Powerful Experience

#Deepin #Linux, the user-friendly and visually stunning operating system, continues to impress with its latest release, V23 Beta3. Packed with exciting new features and improvements, #Deepin V23 offers a cutting-edge experience for both seasoned Linux users and newcomers alike.

**#DeepinLinux #LinuxOS #OperatingSystem

---- A Focus on User Experience

#Deepin has always prioritized user experience, and V23 takes this a step further. The DDE (desktop environment) has received a makeover, boasting a cleaner and more intuitive interface. Additionally, the terminal has been enhanced with improved search functionality and customization options.

#DDE #DesktopEnvironment #UserFriendly #Customization

---- Powerful Upgrades Under the Hood

Beyond aesthetics, V23 packs a punch with performance optimizations and stability improvements. Cross-version upgrades make updating easier, while new package formats like Linglong promise increased security and efficiency.

#Performance #Stability #Upgrades #PackageManagement #Linglong

---- Embrace the #Deepin Community

#Deepin thrives on its active and supportive community. V23 Beta3 invites feedback and contributions, ensuring the final release addresses user needs and preferences. Join the vibrant #Deepin community and contribute to its development!

#Community #OpenSource #Collaboration #Contribute #BetaTesting

---- Dive into the #Deepin Experience

Whether you're a Linux enthusiast or simply looking for a user-friendly alternative, #Deepin V23 is worth exploring. Download the Beta3 and immerse yourself in its intuitive interface, powerful features, and thriving community.

#Download #BetaRelease #TryItOut #JoinTheCommunity #DeepinExperience

#Hashtags for #Deepin Linux and Linux:

#DeepinV23 #LinuxDistro #DesktopLinux #BeginnerFriendly #Customization #OpenSourceSoftware #Security #Performance #CommunityDriven #Development #FreeSoftware #TechEnthusiasts #DistroHopping #UserExperience #DesktopEnvironment #OperatingSystem #Techie #Software #Coding #Productivity #OpenSourceContribution

Thursday, February 1, 2024

Finding files with extensions using find command and files which are 90 days old



find /path/to/search -mtime +90 -type f \( -name "*.txt" -o -name "*.pdf" -o -name "*.doc" \)

This will find all the files in directory /path/to/search which are 90 days old and files having extention as txt, pdf, doc. 

Like this you can add many extention and specify time accordingly to find specified days old files.


Saturday, September 30, 2023

Troubleshooting process-related issues in Linux often involves various commands and checks. Here are some important Linux commands for process troubleshooting

1. **List Running Processes:** Use `ps aux` or `top` to list currently running processes.

2. **Check Process Details:** Use `ps -p <PID>` to view detailed information about a specific process.

3. **Kill a Process:** Use `kill` or `killall` to terminate processes, e.g., `kill <PID>`.

4. **Find Process by Name:** Use `pgrep` to find processes by name, e.g., `pgrep <process_name>`.

5. **View Process Tree:** Use `pstree` to display the process tree.

6. **Check Process Limits:** Use `ulimit -a` to view process-level resource limits.

7. **Check Process CPU Usage:** Use `htop` or `top` to monitor CPU usage by processes.

8. **Check Process Memory Usage:** Use `htop` or `top` to monitor memory usage by processes.

9. **Check Process Disk I/O:** Use `iotop` to monitor disk I/O by processes.

10. **Check Process Network Activity:** Use `iftop` or `nethogs` to monitor network activity by processes.

11. **Check Process Priority:** Use `nice` and `renice` to set or adjust process priority.

12. **Check Open Files by Process:** Use `lsof` to list open files and sockets by process.

13. **Check Process Environment:** Use `cat /proc/<PID>/environ` to view the environment variables of a process.

14. **Check Process Threads:** Use `ps -p <PID> -L` to list threads of a process.

15. **Check Process Dependencies:** Use `ldd` to list shared library dependencies of a binary.

16. **Monitor Process Resource Usage:** Use `sar` or `pidstat` to monitor various resource usage by processes.

17. **Check Process Start Time:** Use `ps -p <PID> -o lstart` to check the start time of a process.

18. **Check Zombie Processes:** Use `ps aux | grep 'Z'` to identify and handle zombie processes.

19. **Check Process Traces:** Use `strace` or `ltrace` to trace system or library calls made by a process.

20. **Process Management with systemd:** Use `systemctl` to start, stop, enable, or disable services and processes managed by systemd.

#ProcessIssues, #ProcessTroubleshooting, #ProcessManagement, #ProcessMonitoring, #ResourceUsage, #ProcessTree, #KillProcess, #CPUUsage, #MemoryUsage, #DiskIO, #NetworkActivity, #ProcessPriority, #OpenFiles, #EnvironmentVariables, #ProcessThreads, #DependencyAnalysis, #ResourceMonitoring, #ZombieProcesses, #ProcessTracing, #SystemdServices

Thursday, September 28, 2023

List of top #Linux distributions categorized by uses








Here is a list of top Linux distributions categorized by uses:

Desktop:

  • Ubuntu
  • Linux Mint
  • Pop!_OS
  • Fedora
  • Elementary OS
  • Zorin OS
  • Manjaro
  • KDE neon
  • Deepin
  • MX Linux
  • Solus

Server:

  • Ubuntu Server
  • CentOS Stream
  • AlmaLinux
  • Debian
  • Fedora Server
  • openSUSE
  • SUSE Linux Enterprise Server (SLES)
  • Red Hat Enterprise Linux (RHEL)

Cloud:

  • Ubuntu Cloud
  • CentOS Stream for Cloud
  • AlmaLinux Cloud
  • Amazon Linux Amazon Linux 2 (AL2)
  • Google Cloud Platform (GCP)
  • Microsoft Azure
  • IBM Cloud
  • Oracle Cloud Platform

Special purpose:

  • Kali Linux (security)
  • Parrot OS (security)
  • Tails OS (privacy)
  • Puppy Linux (low-resource devices)
  • Bodhi Linux (low-resource devices)
  • Lubuntu (low-resource devices)
  • Xubuntu (low-resource devices)
  • Chrome OS (Chromebooks)
  • Android (Android devices)

This is just a small sample of the many Linux distributions available. There are distributions for all sorts of uses, so it's important to do your research to find the one that's right for you.

You can find all distribution details here : https://distrowatch.com/


Wednesday, September 28, 2022

Installing #Manjaro in #VirtualMachine

#Manjaro is a # Linux-based distribution #Manjaro is a free and #opensource #Linux distribution based on the #ArchLinux #operatingsystem that has a focus on user-friendliness and accessibility. It uses a rolling release update model and #Pacman as its #packagemanager. It is developed mainly in #Austria, #France, and #Germany. #Manjaro is a #modern and very #versatile #OperatingSystem based on the #Linux #Kernel. We try to make user interaction as easy as possible, without compromising on #security.

Sunday, August 14, 2022

#Linux #Commands by #Category : #AllLinuxCommand #linux...Linux

#FileOperation
#ls : List files in a directory.
#cp: Copy a file.
#mv: Rename (“move”) a file.
#rm: Delete (“remove”) a file.
#ln: Create links (alternative names) to a file.
#shred: Completely erase a file when the file is deleted

#DirectoryOperation
#cd: Change your current directory.
#pwd: Print the name of your current directory.
#basename: Print the final part of a file path.
#dirname: Print a file path without its final part.
#mkdir: Create (make) a directory.
#rmdir: Delete (remove) an empty directory.
#rm -r: Delete a nonempty directory and its contents.

#ViewingFiles
#cat: View files in their entirety. cat [filename]
#less: View text files one page at a time. less [filename]
#head: View the first lines of a text file. head [filename]
#tail:  View the last lines of a text file. tail [filename]
#nl: View text files with their lines numbered. nl [filename]
#strings: Display text that’s embedded in a binary file. strings [filename]
#od: View data in octal (or other formats). oc [filename]
#xxd: View data in hexadecimal.xxx [filename]
#gv: View PostScript or PDF files. sudo apt install gv [filename]
#xdvi: View TeX DVI files. sudo apt install xdiv xdiv [filename]

#JobControl #commands
#jobs: List your jobs.
#&: Run a job in the background.
#^Z: Suspend the current (foreground) job.
#suspend: Suspend a shell.
#fg: Un-suspend a job: bring it into the foreground.
#bg: Make a suspended job run in the background.
#kill -STOP/-CONT : pausing continuing process

#FileCreation and #Editing
#Vim: Open file/ Create a File
#Vi : Open File/ Create a File.
#Nano : Open File/ Create a File
#Emacs : Open/Create File
#Edit: Graphical File Editor
#Ed: is a line-oriented text editor. It is used to create, display, modify and text files

#File Property Commands
#stat: Display attributes of files and directories.
#wc: Count bytes, words, lines in a file.
#du: Measure disk usage of files and directories.
#file: Identify (guess) the type of a file.
#touch: Change timestamps of files and directories.
#chown: Change owner of files and directories.
#chgrp: Change group ownership of files and directories.
#chmod: Change protection mode of files and directories.
#umask: Set a default mode for new files and directories.
#chattr: Change extended attributes of files and directories.
#lsattr: List extended attributes of files and directories.

#SearchingFiles #Location
#find: Locate files in a directory hierarchy.
#xargs: Process a list of located files (and much more).
#locate: Create an index of files, and search the index for string.
#which: Locate executables in your search path (command).
#type: Locate executables in your search path (bash built-in).
#whereis: Locate executables, documentation, and source files.

#File content manipulation 
#grep: Find lines in a file that match a regular expression.
#cut: Extract columns from a file.
#paste: Append columns.
#tr: Translate characters into other characters.
#sort: Sort lines of text by various criteria.
#uniq: Locate identical lines in a file.
#tee: Copy a file and print it on standard output, simultaneously.

#File #Compression and #Packaging
#tar: Package multiple files into a single file.
#gzip: Compress files with GNU Zip.
#gunzip: Uncompress GNU Zip files.
#bzip2: Compress files in BZip format.
#bunzip2: Uncompress BZip files.
#bzcat: Compress/uncompress BZip files via standard input/output.
#compress: Compress files with traditional Unix compression.
#uncompress: Uncompress files with traditional Unix compression.
#zcat: Compress/uncompress file via standard input/output (gzip or compress).
#zip: Compress files in Windows Zip format.
#unzip: Uncompress Windows Zip files.
#metamail: Extract MIME data to files.

#Filescomparision
#diff: Line-by-line comparison of two files or directories.
#comm: Line-by-line comparison of two sorted files.
#cmp: Byte-by-byte comparison of two files.
#md5sum: Compute a checksum of the given files (MD5).

#Printer/#Printing 
#lpr: Print a file.
#lpq: View the print queue.
#lprm: Remove a print job from the queue.

#Spelling Checking
#look: Look up the spelling of a word quickly.
#aspell: Interactive spelling checker.
#spell: Batch spelling checker.

#Disk and #FileSystem
#df: Show information about the file system on which each FILE resides, or all file systems by default.
#du : Summarize disk usage of the set of FILEs, recursively for directories.
#mount: Make a disk partition accessible.
#umount: Unmount a disk partition (make it inaccessible).
#fsck: Check a disk partition for errors.
#sync: Flush all disk caches to disk.
#lshw :List all hardware
#lsblk :List information about block devices. 
#findmnt: Find a (mounted) filesystem.
#blkid : locate/print block device attributes
#fdisk : Display or manipulate a disk partition table.
#mkfs: Make file filesystem
#mkswap: Make a swap area on a device or in a file
#parted: Disk partitioning and partition resizing program.  It allows the user to create, destroy, resize, move and copy ext2, ext3, Linux-swap,  FAT  and FAT32 partitions.
#sfdisk: List the size of a partition, the partitions on a device, check the partitions on a device, and repartition a device.
#file: Determine type of FILEs

#Backup and #Remote #Storage
#dump: Write a disk partition to a backup medium.
#restore: used for restoring files from a backup created using dump.
#cdrecord: record audio or data CD, DVD or BluRay
#rsync: is a file transfer program capable of efficient remote update via a fast differencing algorithm.
#mt: Control magnetic tape drive operation.
#cpio: copies files to and from archives
#cp/scp : copy/ remote copy files
#dd: in simplest terms copies an image of a selected disk area. Then provides the ability to copy selected blocks of a physical disk.
#tar/zip/gzip : compress files

#Monitoring #Linux system
#ps: List process.
#uptime: View the system load.
#w: List active processes for all users.
#top: Monitor resource-intensive processes interactively.
#htop: utility that allows the user to interactively monitor the system's vital resources or server's processes in real time.
#iotop: display and monitor the disk IO usage details and even gets a table of existing IO utilization by the process
#gnome-system-monitor: Monitor system load and processes graphically.
#xload: Simple, graphical monitor of system load.
#free: Display free memory.
#pidof: Command, which looks up and prints the PID of a process by its name
#nmon: fully interactive performance monitoring command-line utility tool for Linux. It is a benchmark tool that displays performance about the CPU, MEMORY, NETWORK, DISKS, FILE SYSTEM, NFS, TOP PROCESSES, RESOURCES, AND POWER MICRO-PARTITION
#lsof : display a list of all the open files and the processes. The open files included are disk files, network sockets, pipes, devices, and processes.
#iostat: Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions.
#Psacct or Acct : monitor user activities
#whowatch – Monitor Linux Users and Processes in Real Time
#vmstat: display statistics of virtual memory, kernel threads, disks, system processes, I/O blocks, interrupts, CPU activity, and much more

#Network Related
#traceroute: View the network path to a remote host.
#ifconfig: Older command to set and display network interface information.
#netstat: list of all active connections.
#who: List logged-in users, long output.
#tcpdump: listing of all active connections.
#ping: Check if a remote host is reachable.
#ifup/ifdown/ifquery: actives/deactivates/query about state of a network interface.
#nslookup: queries Internet name servers interactively for information.
#dig: stands for Domain Information Groper. It is used for retrieving information about DNS name servers.
#mtr: combines the functionality of the traceroute and ping programs in a single network diagnostic tool.
#ip: used for displaying and manipulating routing, network devices, interfaces.
#ethtool: utility for querying and modifying network interface controller parameters and device drivers.
#route: utility for displaying or manipulating the IP routing table of a Linux system.
#nmcli: scriptable command-line tool to report network status, manage network connections, and control the NetworkManager.
#ss: utility to investigate sockets. It dumps socket statistics and displays information similar to netstat.
#nc: also referred to as the “Network Swiss Army knife”, is a powerful utility used for almost any task related to TCP, UDP, or UNIX-domain sockets. It is used to open TCP connections, listen on arbitrary TCP and UDP ports, perform port scanning plus more.
#host: command is a simple utility for carrying out DNS lookups, it translates hostnames to IP addresses and vice versa.

#Instant #Messaging
#write: Send messages to a terminal.
#mesg: Prohibit talk and write.
#tty: Print your terminal device name.
#wall:  allow us to send messages to another user in the terminal using tty2

#Web #Browsing
#lynx: open source command line browser 
#Links2: text-based browser that you can easily utilize on your terminal with a good user experience.
#elinks: eLinks is similar to Links2 — but it is no longer maintained.
#wget: non-interactive network downloader which is used to download files from the server 
#curl: (short for "Client URL") is a command line tool that enables data transfer over various network protocols
#W3M: open-source text-based web browser for the terminal.

#Email:
#mail: mail command is quite popular and is commonly used to send emails from the command line.
#mailx: Mailx is the newer version of mail command and was formerly referred to as nail in other implementations.
#mutt: Mutt is a lightweight Linux command line email client. Unlike the mail command that can do basic stuff, mutt can send file attachments.
#mpack: mpack command is used to encode the file into MIME messages and sends them to one or several recipients, or it can even be used to post to different newsgroups.
#sendmail: a most popular SMTP server used in most of Linux/Unix distribution. Sendmail allows sending email from command line.
#swaks: command is a scriptable, flexible, transaction-oriented SMTP tool. 
#ssmtp:  send emails using the SMTP server from the Linux terminal.

#Network Connection
#ssh: Securely log into a remote host, or run commands on it.
#telnet: Log into a remote host (insecure!).
#scp: Securely copy files to/from a remote host (batch).
#sftp: Securely copy files to/from a remote host (interactive).
#ftp: Copy files to/from a remote host (interactive, insecure!).

#Host Location
#host: Look up hostnames, IP addresses, and DNS info.
#whois: Look up the registrants of Internet domains.
#ping: Check if a remote host is reachable.
#traceroute: View the network path to a remote host.
#dig: dig is a tool for querying DNS nameservers 

#Host Information:
#uname: Print basic system information.
#lshw: extract detailed information on the hardware configuration of the machine
#lscpu: gathers CPU architecture information from sysfs, /proc/cpuinfo and any applicable architecture-specific libraries
#lsblk: lists information about all available or the specified block devices
#lsusb: displaying information about USB buses in the system and the devices connected to them
#lspci: utility for displaying information about PCI buses in the system and devices connected to them
#dmidecode: hardware information by reading data from the DMI tables
#hostname: Print the system’s hostname.
#dnsdomainname: Same as hostname -d.
#domainname: Same as hostname -y.
#nisdomainname: Same as hostname -y.
#ypdomainname: Same as hostname -y.
#ip: Set and display network interface information.
#ifconfig: Older command to set and display network interface information.
#hwinfo is used to probe for the hardware present in the system. It can be used to generate a system overview log which can be later used for support.

#User Management 
#useradd: Create an account.
#userdel: Delete an account.
#usermod: Modify an account.
#passwd: Change a password.
#chfn: Change a user’s personal information.
#chsh: Change a user’s shell.

#Group Management
#groups: Print the group membership of a user.
#groupadd: Create a group.
#groupdel: Delete a group.
#groupmod: Modify a group.

#User and Environment:
#logname: Print your login name.
#whoami:  Print your current, effective username.
#id: Print the user ID and group membership of a user.
#who: List logged-in users, long output.
#users: List logged-in users, short output.
#finger: Print information about users.
#last: Determine when someone last logged in.
#printenv: Print your environment.

#Login Logout Shutdown Reboot 
#shutdown: arranges for the system to be brought down in a safe way,All logged-in users are notified that the system is going down and, within the last five minutes of TIME, new logins are prevented.
#reboot: This will reboot the system immediately
#pm-hibernate/systemctl hibernate: Most of the computer’s hardware is not capable of Hibernation. You can enter the pm-hibernate command and check.
#init 0 : Shutsdown the system
#init 6 : will reboot the system
#systemctl [halt/poweroff/reboot/suspend/hibernate] : uses systemctl command to perform action
#halt/halt -p: command allows you to halt the system, without actually powering down. if we use -p it will power off too
#poweroff: command which allows you to power off the system after shutting down.

#Scheduling jobs in Linux
#sleep: Wait a set number of seconds, doing nothing.
#watch: Run a program at set intervals.
#at: Schedule a job for a single, future time.
#crontab: Schedule jobs for many future times.

#Controlling Process:
#kill: Terminate a process (or send it a signal).
#killall: When started by a root user, the killall command cancels all cancellable processes except those processes that started it
#nice:  Invoke a program at a particular priority.
#renice: Change a process’s priority as it runs.
#cpulimit: interrupt execution of a process (or process group) if the CPU/system load goes beyond a defined threshold.
#ulimit: Used to define various limits on files/process/memory etc

Tuesday, June 16, 2015

Extract All Tar Files in a directory in Linux

This will first list the files containing extension tar.gz, and then awk will get the file names which is column 9 in

ls -lrth command, and

NF > 2 will remove the blank line and

tar -xvzf will extract files names contained in variable $i,

Like this we can experiment various operations like renaming all files with specific extension of so and can fiddled with to achieve various goals.


for i in `ls -lrth *.tar.gz |awk  'NF>2 {print $9}'`; do tar -xvzf $i; done

Monday, February 10, 2014

Linux: Crontab - Brief


I always get confuse whenever I want to set a new cron job. The confuse is with regard to the options too be set!
For those who new to 'cron', its nothing but, an event scheduler in Linux. That means, you can schedule any script to run at any time you wanted to. Its just the system/server should be up and running!

cron job is specific to every user in Linux/Unix. So, one can't see other's cron unless the necessary privileges or sudo root access given.

Whatever, here is the options in cron:


To check cron jobs:

[root@localhost kiran]# crontab -l
no crontab for root


To set cron jobs:

[root@localhost kiran]# crontab -e


After adding, here is how it looks:

[root@localhost kiran]# crontab -l
##Script to test
00 */2 1-31 * 0,2,3   sh /home/kiran/test.sh >> /dev/null







Every Cron job should be given with 5 options:


  • minute -> 0-59
  • hour -> 0-23
  • day of month -> 1-31
  • month -> 1-12 
  • day of week -> 0-7 (0 is Sunday )

In the above example:

00 -- 0th Minute
*/2 -- Every 2 hours
1-31 -- Every day (1 to 31)
* -- Every Month
0,2,3 -- Sunday,Tuesday,Wednesday


Thursday, April 4, 2013

Insert string after each N lines in a file

We can do this as follows:

awk '1;!(NR%<Number after which the line has to be insserted>){print "String to be inserted";}' origionalfiletoprocess >outfilewithinsertedstring

Eg:

awk '1;!(NR%100){print "Shashwat Shriparv";}' filecontainingtxt>outputfilewithnewinsertedlines

This command will read filecontainingtxt and will insert string Shashwat Shriparv after 100 lines the the output fill will be outputfilewithnewinsertedlines

Tuesday, January 29, 2013

View file sise sorted, file size/folder size sorted in size

du -sm * | sort -nr --> Decending

du -sm * | sort -n  --> Ascending

du -sc * | sort -nr --> Total size of current folder

du -sm * | sort -nr | head -10 --> First 10 : Top 10 Largest Items

du -sm * | sort -nr | tail -10
--> Last 10

ls -ltr | grep [0-9][0-9][0-9]M/G  -->  will show files withree digit number in MB or GB

Friday, January 18, 2013

Shell script: Using FOR loop

Here's a simple shell script to print numbers using for loop.

Just got through:


# cat test.sh

for ((i=0;i<=10;i++))
do

 echo $i

done



Output:

Monday, January 14, 2013

Linux : Prefix a string to all rows in a file - sed

Consider, you have a file like below:

# cat test.txt
12324
234523
3431
343
34345
3434
43234


Now, if you want to prefix a particular string to each line in the file, how will you do it? This is a common challenge for DBA/Developers working with Linux environment.

Saturday, January 12, 2013

Linux: Comparing 2 files - 'comm'

Many a times, i encountered the situation wherein I would be having 2 files with some values in each. And I need to get common records in both the files and also, unique records for each files.

So, this is how  I do - one of the easiest way.

Below are the files to be compared:

Tuesday, January 8, 2013

Linux: Add numbers in a column in a file

In windows we use Excel to add all the numbers in a column. But how about Unix/Linux?
We encountered such an requirement and we got the answer too.
Actually solution in much more simpler than the problem..!

Mission accomplished by 'awk' command. Its merely a very powerful and useful command.
Here is an example for it:

Tuesday, January 1, 2013

Find and remove files older than 'n' days !


Sometimes we schedule a particular daily job in cron, which generates daily log files. Though the size is smaller, we can't keep those files. In that case we need a shell command to clean up and here it is:

To delete all the files whose data modified before 'n' days:

find -mtime +n -delete    


To delete all the files whose data modified in last 'n' days:

find -mtime -n -delete    


To delete files of a particular patterns, say 'archive_date.csv'

find -name 'archive_*.csv' -mtime +n -delete    


To list out all files older than 'n' days along with date and time, just like 'ls' command:

find -mtime +n -ls   


These are simple commands, but very useful. 
Modify as per your need.
Thanks!











Featured Posts

Kali Linux Remote Desktop: Access GNOME from Windows Using Native RDP

  Kali Linux + GNOME 50 + GNOME Remote Desktop + Windows Remote Desktop (MSTSC) Getting a full GNOME desktop remotely on Kali Linux can be ...