Config Router

  • Google Sheets
  • CCNA Online training
    • CCNA
  • CISCO Lab Guides
    • CCNA Security Lab Manual With Solutions
    • CCNP Route Lab Manual with Solutions
    • CCNP Switch Lab Manual with Solutions
  • Juniper
  • Linux
  • DevOps Tutorials
  • Python Array
You are here: Home / Juniper / Useful Unix commands in the router/’svl-jtac-tool’ shell

Useful Unix commands in the router/’svl-jtac-tool’ shell

July 3, 2016 by Marques Brownlee

This article provides information about the useful Unix commands that can be used in the router/svl-jtac-tool shell during troubleshooting and normal operations.

Information about the useful Unix commands that can be used in the router/svl-jtac-tool shell during troubleshooting and normal operations.

Customized search in different locations:

  • . current directory
  • / whole system
  • ~ Home directory

To list all the files whose file size is bigger than 4096 bytes, use the following command:

root@mx480-6% find . -type f -size +4096c

To list all the files whose file size is smaller than 4096 bytes, use the following command:

root@mx480-6% find . -type f -size -4096c

To list all the file names whose file size is greater than 512bytes and owner is lab (check this in the router), use the following command:

root@mx480-6% ls -al | awk '$3 == "lab" && $5 > 512 {print $9}'

To list all file names whose file size is greater than 512bytes and owner is rengar (check this in the server), use the following command:

> ls -al | awk '$3 == "rengar" && $5 > 512 {PRINT.EN_US}'

To calculate the total size of a directory in Mb, use the following command:

> ls -al | awk '{total +=$5};END {print "Total size: "total/1024/1024 " Mb"}'

To calculate the total size of a directory, including sub directories, in Mb, use the following command:

> ls -lR | awk '{total +=$5};END {print "Total size: "total/1024/1024 " Mb"}'

To identify the largest file in a directory, including sub directories, use the following command:

root@mx480-6% ls -lR |awk '{print $5 "\t" $9}' |sort -n |tail -1

To delete leading whitespace (spaces, tabs) from the beginning of each line, use the following command:

root@mx480-6% sed 's/^[ \t]*//' file-name

To delete trailing whitespace (spaces, tabs) from the end of each line, use the following command:

root@mx480-6% sed 's/[ \t]*$//' filename

To delete both leading and trailing whitespaces from each line, use the following command:

root@mx480-6% sed 's/^[ \t]*//;s/[ \t]*$//' file-name

To delete all blank lines from a file, use the following command:

root@mx480-6% sed '/^$/d' file-name

To clear the terminal screen, use the following commands:

$ CTRL+l
$ reset

 

Related

Filed Under: Juniper

Recent Posts

  • How do I give user access to Jenkins?
  • What is docker volume command?
  • What is the date format in Unix?
  • What is the difference between ARG and ENV Docker?
  • What is rsync command Linux?
  • How to Add Music to Snapchat 2021 Android? | How to Search, Add, Share Songs on Snapchat Story?
  • How to Enable Snapchat Notifications for Android & iPhone? | Steps to Turn on Snapchat Bitmoji Notification
  • Easy Methods to Fix Snapchat Camera Not Working Black Screen Issue | Reasons & Troubleshooting Tips to Solve Snapchat Camera Problems
  • Detailed Procedure for How to Update Snapchat on iOS 14 for Free
  • What is Snapchat Spotlight Feature? How to Make a Spotlight on Snapchat?
  • Snapchat Hack Tutorial 2021: Can I hack a Snapchat Account without them knowing?

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in