How would you truncate a log file that is growing too large
if you don't have space to compress it or to move it
somewhere else? How would you do it?

Answers were Sorted based on User's Feedback



How would you truncate a log file that is growing too large if you don't have space to compre..

Answer / bipin bapurao sautadekar

more two commands to truncate the file.

# cat /dev/null > filename
# cat > filename and then press ctrl+c

Is This Answer Correct ?    9 Yes 0 No

How would you truncate a log file that is growing too large if you don't have space to compre..

Answer / syed

Why not you try by using below command

> <file name>

Is This Answer Correct ?    10 Yes 2 No

How would you truncate a log file that is growing too large if you don't have space to compre..

Answer / chris lowder

cp /dev/null <File Name>

Is This Answer Correct ?    6 Yes 3 No

Post New Answer

More Solaris Commands Interview Questions

How to remove the root mirror

2 Answers  


Explain inode

3 Answers   HP,


What are the differences between the command line and graphical user interface?

0 Answers  


Why copied file permission is changed in destination. When i give all permission i.e 777 to file and copy that to other location in destination the permission is 755. But if give permission 555 in destination that file permission is 755 and if give permission 444 to file after copy in destination the file permission is 444. These all are happening in normal user. How the umask value is calculate here really i am not understand. Please every body and wite the proper answer. Thanks in Advance

2 Answers  


How to change the default new user shell without mentioning -s /bin/sh in cmd useradd or usermod and which file we need to change? this is not for existing user

4 Answers   Tech Mahindra,






How to find the plex, sub disk, Volume group, disk status, free spaces, disk controller, Volume controller?

1 Answers  


Which command to lock the user Account?

3 Answers  


As a user how he can change is passwd with root privilege.

2 Answers  


Explain about Vxrecover?

3 Answers   EDS,


How do you find the number of Network card attached to your server ?

4 Answers  


I don’t want to ask password reset in ever month to particular user. How to enable the same for only one user.

3 Answers  


How to review multiple MAC Addess in Solaris?

9 Answers   HP,


Categories
  • Solaris Commands Interview Questions Solaris Commands (360)
  • Solaris Threads Interview Questions Solaris Threads (9)
  • Solaris IPC Interview Questions Solaris IPC (30)
  • Solaris Socket Programming Interview Questions Solaris Socket Programming (3)
  • Solaris System Calls Interview Questions Solaris System Calls (25)
  • Solaris General Interview Questions Solaris General (170)
  • Solaris AllOther Interview Questions Solaris AllOther (297)