<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ali Reza</title>
    <description>The latest articles on DEV Community by Ali Reza (@salimzadeh).</description>
    <link>https://dev.to/salimzadeh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F198354%2F0f015d56-3138-4e4a-92d7-e1f69132e65f.png</url>
      <title>DEV Community: Ali Reza</title>
      <link>https://dev.to/salimzadeh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/salimzadeh"/>
    <language>en</language>
    <item>
      <title>Clean all log file with one command</title>
      <dc:creator>Ali Reza</dc:creator>
      <pubDate>Sun, 28 Jul 2024 10:17:24 +0000</pubDate>
      <link>https://dev.to/salimzadeh/clean-all-log-file-with-one-command-5fg4</link>
      <guid>https://dev.to/salimzadeh/clean-all-log-file-with-one-command-5fg4</guid>
      <description>&lt;h2&gt;
  
  
  Find
&lt;/h2&gt;

&lt;p&gt;this command search for files in a directory hierarchy.&lt;/p&gt;

&lt;h3&gt;
  
  
  exec switch
&lt;/h3&gt;

&lt;p&gt;This switch can execute the command for each item found.&lt;/p&gt;

&lt;h2&gt;
  
  
  tee
&lt;/h2&gt;

&lt;p&gt;read from standard input and write to standard output and files.&lt;br&gt;
now pass &lt;code&gt;{} \; &amp;lt;/dev/null&lt;/code&gt; to this command to remove each content from file .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find  / -type f -name "*.log" -exec tee {} \; &amp;lt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>List of the largest files and folders in linux</title>
      <dc:creator>Ali Reza</dc:creator>
      <pubDate>Sat, 27 Jul 2024 12:23:04 +0000</pubDate>
      <link>https://dev.to/salimzadeh/list-of-the-largest-files-and-folders-20jj</link>
      <guid>https://dev.to/salimzadeh/list-of-the-largest-files-and-folders-20jj</guid>
      <description>&lt;p&gt;To get the list of the largest files and folders, we use several commands together :&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;du: The 'du' command in Linux is used to estimate file and directory space usage. &lt;/li&gt;
&lt;li&gt;pipeline( &lt;strong&gt;|&lt;/strong&gt; ): The Pipe is a command in Linux that lets you use two or more commands such that output of one command serves as input to the next.&lt;/li&gt;
&lt;li&gt;grep: Grep is a useful command to search for matching patterns in a file.&lt;/li&gt;
&lt;li&gt;sort: SORT command is used to sort a file, arranging the records in a particular order.&lt;/li&gt;
&lt;li&gt;head: The 'head' command in Linux is used to display the first part of files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now use this command together:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;du -ah / | grep -v "/$" | sort -rh | head -10&lt;/code&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>cli</category>
    </item>
    <item>
      <title>Docker's Command</title>
      <dc:creator>Ali Reza</dc:creator>
      <pubDate>Sun, 21 Jul 2024 05:42:15 +0000</pubDate>
      <link>https://dev.to/salimzadeh/dockers-command-l9i</link>
      <guid>https://dev.to/salimzadeh/dockers-command-l9i</guid>
      <description>&lt;h1&gt;
  
  
  Some important Docker commands
&lt;/h1&gt;

&lt;h4&gt;
  
  
  Build Image from a Dockerfile
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker build -t {IMAGE_NAME} .&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  List local images
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker images&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker image ls&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker image ls -a&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Remove one or more images
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker rmi {IMAGE_NAME} {IMAGE_NAME}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  remove unused images (all images)
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker images prune&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker images prune -a&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Login to Docker Hub (or private repository)
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker login -u {USERNAME}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Pulling image from Docker Hub (or private repository)
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker pull {IMAGE_NAME}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Start container
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker run {IMAGE_NAME}&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker run --name {container_name} {IMAGE_NAME}&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker run -p {HOST_PORT}:{CONTAINER_PORT} --name {container_name} {IMAGE_NAME}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Stop container
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker stop {CONTAINER_NAME/CONTAINER_ID}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Remove stoped container
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker rm {CONTAINER_NAME/CONTAINER_ID}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  run command in container
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker exec -it {CONTAINER_NAME/CONTAINER_ID} {COMMAND}&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Fetch container logs
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker logs {CONTAINER_NAME/CONTAINER_ID}&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker logs {CONTAINER_NAME/CONTAINER_ID} -f&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  List of running containers
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker ps&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker ps -a&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Container state
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker container states&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Compose
&lt;/h2&gt;

&lt;p&gt;Define and run multi-container applications with Docker.&lt;br&gt;
&lt;a href="https://docs.docker.com/compose/reference/" rel="noopener noreferrer"&gt;read_more&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Builds, (re)creates, starts, and attaches to containers for a service.
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker compose up&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker compose up -d&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Fetch container service
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker compose logs {SERVICE_NAME}&lt;/code&gt;&lt;br&gt;
&lt;code&gt;docker compose logs {SERVICE_NAME} -f&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  run command in service
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;docker compose exec -it {SERVICE_NAME} {COMMAND}&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Useful links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.docker.com/reference/cli/docker/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt;&lt;br&gt;
&lt;a href="https://docs.docker.com/compose/reference/" rel="noopener noreferrer"&gt;Docker Compose&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/docker/awesome-compose" rel="noopener noreferrer"&gt;Awesome compose projects&lt;/a&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>cli</category>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>The most used Linux commands</title>
      <dc:creator>Ali Reza</dc:creator>
      <pubDate>Tue, 09 Jul 2024 09:10:09 +0000</pubDate>
      <link>https://dev.to/salimzadeh/the-most-used-linux-commands-23ed</link>
      <guid>https://dev.to/salimzadeh/the-most-used-linux-commands-23ed</guid>
      <description>&lt;p&gt;Here are the must used Linux/Ubuntu commands :&lt;/p&gt;

&lt;h3&gt;
  
  
  File System Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;pwd:&lt;/code&gt; Print the name of the current working directory.&lt;br&gt;
&lt;code&gt;date:&lt;/code&gt; print or set the system date and time.&lt;br&gt;
&lt;code&gt;ls:&lt;/code&gt; List information about the FILEs (the current directory by default).&lt;br&gt;
&lt;code&gt;cd:&lt;/code&gt; Change the shell working directory.&lt;br&gt;
&lt;code&gt;touch:&lt;/code&gt; Update the access and modification times of each FILE to the current time.&lt;br&gt;
&lt;code&gt;cat:&lt;/code&gt; Concatenate FILE(s) to standard output.&lt;br&gt;
&lt;code&gt;cp:&lt;/code&gt; Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.&lt;br&gt;
&lt;code&gt;mv:&lt;/code&gt; Move SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.&lt;br&gt;
&lt;code&gt;rm:&lt;/code&gt; Remove (unlink) the FILE(s).&lt;br&gt;
&lt;code&gt;mkdir:&lt;/code&gt; Create the DIRECTORY(ies), if they do not already exist.&lt;br&gt;
&lt;code&gt;rmdir:&lt;/code&gt; Remove the DIRECTORY(ies), if they are empty.&lt;br&gt;
&lt;code&gt;echo:&lt;/code&gt; Print each text after echo.&lt;br&gt;
&lt;code&gt;vi&lt;/code&gt;:Usefull and simple editor&lt;br&gt;
&lt;code&gt;chmod:&lt;/code&gt; Change the mode of each FILE to MODE.&lt;br&gt;
&lt;code&gt;chown:&lt;/code&gt; Change the owner and/or group of each FILE to OWNER and/or GROUP.&lt;br&gt;
&lt;code&gt;find:&lt;/code&gt; Utility for comprehensive file and directory.&lt;br&gt;
&lt;code&gt;grep:&lt;/code&gt; Search for matching patterns in a file.&lt;br&gt;
&lt;code&gt;dd:&lt;/code&gt; Copy a file, converting and formatting according to the operands.&lt;br&gt;
&lt;code&gt;tail:&lt;/code&gt; Output the last part of files&lt;br&gt;
&lt;code&gt;head:&lt;/code&gt; Output the first part of files&lt;br&gt;
&lt;code&gt;more:&lt;/code&gt; Filter for paging through text one screenful at a time.&lt;br&gt;
&lt;code&gt;less:&lt;/code&gt; Like more with many other feture.&lt;/p&gt;

&lt;h3&gt;
  
  
  Process Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ps:&lt;/code&gt; Report a snapshot of the current processes.&lt;br&gt;
&lt;code&gt;kill:&lt;/code&gt; Send a signal to a job.&lt;br&gt;
&lt;code&gt;top:&lt;/code&gt; Display Linux processes&lt;br&gt;
&lt;code&gt;htop:&lt;/code&gt; Display Linux processes with many fetures.&lt;br&gt;
&lt;code&gt;free:&lt;/code&gt; Display amount of free and used memory in the system&lt;/p&gt;

&lt;h3&gt;
  
  
  Device Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;df:&lt;/code&gt; Show information about the file system on which each FILE resides,&lt;br&gt;
&lt;code&gt;du:&lt;/code&gt; Summarize disk usage of the set of FILEs, recursively for directories.&lt;br&gt;
&lt;code&gt;lsmod:&lt;/code&gt; Show the status of modules in the Linux Kernel.&lt;br&gt;
&lt;code&gt;lsblk:&lt;/code&gt; List block devices like hard disk and partions.&lt;br&gt;
&lt;code&gt;fdisk:&lt;/code&gt; manipulate disk partition table&lt;br&gt;
&lt;code&gt;mount:&lt;/code&gt; Mount a filesystem.&lt;br&gt;
&lt;code&gt;umount:&lt;/code&gt; Unmount filesystems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Package Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;apt:&lt;/code&gt; Provides a high-level commandline interface for the package management system.&lt;br&gt;
&lt;code&gt;apt-get update:&lt;/code&gt; Update package lists.&lt;br&gt;
&lt;code&gt;apt-get install:&lt;/code&gt; Install new packages.&lt;br&gt;
&lt;code&gt;apt-get remove:&lt;/code&gt; Remove packages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Archive Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;tar:&lt;/code&gt; Saves many files together into a single tape or disk archive.&lt;br&gt;
&lt;code&gt;xz:&lt;/code&gt; Compress or decompress .xz and .lzma files&lt;br&gt;
&lt;code&gt;zip:&lt;/code&gt; Saves many files together into a single tape or disk archive in zip format.&lt;br&gt;
&lt;code&gt;unzip:&lt;/code&gt; Un zip archive file .&lt;/p&gt;

&lt;h3&gt;
  
  
  Networking
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ping:&lt;/code&gt; Send ICMP ECHO_REQUEST to network hosts&lt;br&gt;
&lt;code&gt;netstat:&lt;/code&gt; Symbolically displays the contents of various network-related data structures.&lt;br&gt;
&lt;code&gt;ifconfig:&lt;/code&gt; Used to configure / show the kernel-resident network interfaces.&lt;br&gt;
&lt;code&gt;ip:&lt;/code&gt; Show and manipulate routing, network devices, interfaces and tunnels.&lt;br&gt;
&lt;code&gt;iptables:&lt;/code&gt; Administration tool for IPv4/IPv6 packet filtering and NAT.&lt;br&gt;
&lt;code&gt;wget:&lt;/code&gt; A non-interactive network retriever.&lt;br&gt;
&lt;code&gt;curl:&lt;/code&gt; curl is a tool for transferring data from or to a server.&lt;br&gt;
&lt;code&gt;ssh:&lt;/code&gt; Program for logging into a remote machine and for executing commands on a remote machine.&lt;br&gt;
&lt;code&gt;scp:&lt;/code&gt; Copies files between hosts on a network.&lt;br&gt;
&lt;code&gt;ssh-keygen:&lt;/code&gt; OpenSSH authentication key utility.&lt;br&gt;
&lt;code&gt;ssh-copy-id:&lt;/code&gt; Script that uses ssh to log into a remote machine.&lt;br&gt;
&lt;code&gt;rsync:&lt;/code&gt; Fast and extraordinarily versatile file copying tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  System Information
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;man:&lt;/code&gt; An interface to the on-line reference manuals&lt;br&gt;
&lt;code&gt;uname:&lt;/code&gt; Print certain system information. With no OPTION, same as -s.&lt;br&gt;
&lt;code&gt;whoami:&lt;/code&gt; Print the user name associated with the current effective user ID.&lt;br&gt;
&lt;code&gt;sudo:&lt;/code&gt; execute a command as another user&lt;br&gt;
&lt;code&gt;hostnamectl:&lt;/code&gt; Query and change the system hostname and related settings.&lt;br&gt;
&lt;code&gt;history:&lt;/code&gt; Show history of command input by user&lt;/p&gt;

&lt;h3&gt;
  
  
  System Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;systemctl:&lt;/code&gt; Control the systemd system and service manager&lt;br&gt;
&lt;code&gt;journalctl:&lt;/code&gt; Query the systemd journal&lt;br&gt;
&lt;code&gt;crontab:&lt;/code&gt; Maintain crontab files for individual users&lt;br&gt;
&lt;code&gt;usermod:&lt;/code&gt; Modify a user account.&lt;br&gt;
&lt;code&gt;adduser:&lt;/code&gt; Add user to the system.&lt;br&gt;
&lt;code&gt;addgroup:&lt;/code&gt; Add group to the system.&lt;br&gt;
&lt;code&gt;passwd:&lt;/code&gt; Change user password.&lt;br&gt;
&lt;code&gt;reboot:&lt;/code&gt; halt, poweroff, reboot may be used to halt, power-off, or reboot the machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Management
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;awk:&lt;/code&gt; Pattern scanning and processing language&lt;br&gt;
&lt;code&gt;ln:&lt;/code&gt; Make links between files&lt;br&gt;
&lt;code&gt;tee:&lt;/code&gt; Read from standard input and write to standard output and files&lt;br&gt;
&lt;code&gt;cut:&lt;/code&gt; Remove sections from each line of files&lt;br&gt;
&lt;code&gt;tr:&lt;/code&gt; Translate, squeeze, and/or delete characters from standard input, writing to standard output.&lt;br&gt;
&lt;code&gt;sort:&lt;/code&gt; Write sorted concatenation of all FILE(s) to standard output.&lt;br&gt;
&lt;code&gt;uniq:&lt;/code&gt; Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT&lt;br&gt;
&lt;code&gt;git:&lt;/code&gt; Tool for manage versioning.&lt;/p&gt;

&lt;p&gt;These commands are for interacting with a Linux system and by using them you can do many daily tasks.&lt;br&gt;
Note that some of these commands require package installation (such as the zip command).&lt;/p&gt;

&lt;p&gt;Good luck&lt;/p&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>shell</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
