IT Questions and Answers :)

Thursday, January 30, 2020

On Linux, what is the output of: find . -print -mtime -10

On Linux, what is the output of: find . -print -mtime -10

  • Only those files in & below the current directory with modification times greater than 10 days.
  • Only those files in & below the current directory with modification times from exactly 10 days ago.
  • Only those files in & below the current directory with modification times less than 10 minutes.
  • All files found in & below the current directory. 
On Linux, what is the output of: find . -print -mtime -10

EXPLANATION

Expressions in "find" are evaluated left to right.  In the command given, "-print" is the first action in the expression, so each file found is printed.  Each file is evaluated against "-mtime -10", but no corresponding action follows the -mtime test.  Adding "-ls" to the end of the expression will make it clear, because those files with modification dates of less than 10 days will then be listed again, but in a different format.
Find and print everything below the current directory:
$ find  .  -print
.
./May
./May/file03
./May/file01
./May/file02
./May/file04
./June
./June/file03
./June/file01
./June/file02
./June/file04
./July
./July/file03
./July/file01
./July/file02
./July/file04
Test the "find" command, as given in the challenge:
$ find  .  -print  -mtime -10
.
./May
./May/file03
./May/file01
./May/file02
./May/file04
./June
./June/file03
./June/file01
./June/file02
./June/file04
./July
./July/file03
./July/file01
./July/file02
./July/file04
Append another action for the "find" command, "-ls", which will list  those files again that have modification times of less than 10 days:
$ find  .  -print  -mtime -10 -ls
.
2370731    4 drwxr-xr-x   5 dan      users        4096 Jul 14 21:11 .
./May
2506551    4 drwxr-xr-x   2 dan      users        4096 Jul 14 21:17 ./May
./May/file03
./May/file01
./May/file02
./May/file04
./June
2506552    4 drwxr-xr-x   2 dan      users        4096 Jul 14 21:18 ./June
./June/file03
./June/file01
./June/file02
./June/file04
./July
2506554    4 drwxr-xr-x   2 dan      users        4096 Jul 14 21:18 ./July
./July/file03
./July/file01
./July/file02
./July/file04
Understanding that the order of evaluation moves left to right is critical. If the specified action had been "-delete", instead of "-print", every file from the current directory down would have been deleted.
http://man7.org/linux/man-pages/man1/find.1.html
Warnings: Don't forget that the find command line is evaluated as an expression, so putting -delete first will make find try to delete everything below the starting points you specified.
See also:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html
https://www.gnu.org/software/findutils/manual/html_node/find_html/find-Expressions.html#find-Expressions



SOURCE

http://man7.org/linux/man-pages/man1/find.1.html
Share:

Wednesday, January 29, 2020

On a Linux system, what is the output of " ls -si /tmp "

On a Linux system, what is the output of " ls -si /tmp "

  • Human-readable sizes of names in /tmp using powers of 1000
  • Index (inode) number of each name in /tmp, the allocated size in blocks of each name, and the name
  • Human-readable size of names in /tmp using powers of 1024
  • Names in /tmp sorted by inode number 

On a Linux system, what is the output of " ls -si /tmp "

EXPLANATION

Most Linux utilities, including "ls", can be used with short options (prefixed with a single hyphen), or long options, (prefixed with two hyphens).  Some Linux utilities, like "tar" and "ps", do not require a prefix for short options.  Multiple short options may be combined following a single hyphen.
So the short option for size,  " -s ", may be combined with the short option for inode,  " -i ", as in 
ls -si  /tmp
Short options can be given in any order, but the order of the options does not affect the order of the output.
Long options (more than one character), are prefixed with two hyphens, as in
ls  --si  /tmp
The long option above, " --si ", is not the same as the combined short options, " -si ", and the long option, "--si",   will list the allocated block sizes of the names in /tmp in human-readable form using powers of 1000 (as opposed to 1024).

SOURCE

http://www.man7.org/linux/man-pages/man1/ls.1.html
Share:

Tuesday, January 28, 2020

You are connecting an external modem to a legacy (non-plug and play) PC which has 4 existing com ports. A serial mouse is already using com1. Which of the following ports could you use?

You are connecting an external modem to a legacy (non-plug and play) PC which has 4 existing com ports. A serial mouse is already using com1. Which of the following ports could you use?

  • 2 or 4
  • 3 or 4
  • 1 or 3
  • 2 or 3 

You are connecting an external modem to a legacy (non-plug and play) PC which has 4 existing com ports. A serial mouse is already using com1. Which of the following ports could you use?

EXPLANATION

Com ports 1 and 3 share the same IRQ (4), whereas Com ports 2 and 4 share IRQ 3. Under normal circumstances,
serial devices can share the IRQ, however, in the case of a mouse, it would have required a driver which would constantly be active, not giving another serial device the opportunity to use the IRQ. So any answer with COM3 would be invalid.

SOURCE

https://en.wikibooks.org/wiki/A%2B_Certification/Exam_Objectives/Hardware/Basics/CPU/IRQ
Share:

Friday, January 24, 2020

In the Cisco IOS CLI for Wireless Access points, what do the following command : " debug capwap client no-reload "

In the Cisco IOS CLI for Wireless Access points, what do the following command : " debug capwap client no-reload "

  • prevents the AP from reloading when it can't join a controller
  • it prevents the AP from reloading when it has active clients in any of the SSIDs
  • prevents the clients from joining the AP during the configuration of it
  • It debugs the latest error logs from the AP 

In the Cisco IOS CLI for Wireless Access points, what do the following command : " debug capwap client no-reload "

EXPLANATION

This is a hidden command that prevents the Access Point from reloading (restart) after trying and do not find a Wireless LAN controller to join its AP pool, this happens only if the Access point is configured as a Lightweight access point.

SOURCE

https://community.cisco.com/t5/wireless-mobility-documents/installing-autonomous-ios-aios-on-a-lightweight-ap-from-the-cli/ta-p/3111153

https://cciewirelessnotes.wordpress.com/tag/capwap/
Share:

Thursday, January 23, 2020

In T-SQL, which of the following is the purpose of the 'WITH' statement?

In T-SQL, which of the following is the purpose of the 'WITH' statement?

  • Create a Common Table Expression
  • Create a derived table
  • Specify filter criteria
  • Join more than two tables 

In T-SQL, which of the following is the purpose of the 'WITH' statement?

EXPLANATION

'WITH' allows you to define a Common Table Expression (a derived table that is referenced and can be referred to multiple times within a query). 'WHERE' would usually be used to specify a filter. A derived table would be written as part of the query and can only be referenced in that instance.
'JOIN' would be used to join tables together regardless of how many.
See: https://msdn.microsoft.com/en-us/library/ms175972.aspx for more details.

SOURCE

https://docs.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql
Share:

Popular Posts