Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show/Change Work Directory in SQLite

Tags:

sql

sqlite

Does SQLite have a command which displays what directory I am working in on the command line?

Also, how to change work directory there?

like image 612
Concerned_Citizen Avatar asked Mar 27 '13 18:03

Concerned_Citizen


2 Answers

sqlite3 does have the concept of a current directory (although it is "deferring" to the underlying shell); otherwise it wouldn't have a .cd DIRECTORY command.

To mimic pwd you can use:

sqlite> .shell pwd
/Users/brad/

The syntax is .shell CMD ARGS..., which allows you to

Run CMD ARGS... in a system shell

To change the directory, use .cd:

sqlite> .cd /Users/yourname/directory/

The .cd command was added in version 3.20.0 (released 2017-08-01).

like image 122
Brad Solomon Avatar answered Nov 20 '22 12:11

Brad Solomon


.shell cd can help you to show the current directory.

For changing the directory, you are gonna need to set it up at the beginning.

like image 7
Warren Wang Avatar answered Nov 20 '22 11:11

Warren Wang